るりまサーチ

最速Rubyリファレンスマニュアル検索!
146件ヒット [1-100件を表示] (0.086秒)

別のキーワード

  1. psych psych_y
  2. psych y
  3. kernel y
  4. kernel psych_y
  5. y syck

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 > >>

Array#last(n) -> Array (21235.0)

末尾の n 要素を配列で返します。n は 0 以上でなければなりません。

...TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

@raise ArgumentError n が負値の場合発生します。

//emlist[例][ruby]{
ary = [0, 1, 2]
p ary.last(0)
p ary.last(1)
p ary.last(2)
p ary.last...
...(3)
p ary.last(4)
# => []
# [2]
# [1, 2]
# [0, 1, 2]
# [0, 1, 2]
//}

@see Array#first...

Array#last -> object | nil (21120.0)

配列の末尾の要素を返します。配列が空のときは nil を返します。

...配列の末尾の要素を返します。配列が空のときは nil を返します。

//emlist[例][ruby]{
p [0, 1, 2].last #=> 2
p [].last #=> nil
//}

@see Array#first...

CGI::QueryExtension::Value#last -> self (18102.0)

@todo

@todo

RubyVM::AbstractSyntaxTree::Node#last_column -> Integer (9108.0)

ソースコード中で、self を表すテキストが最後に現れる列番号を返します。

...ソースコード中で、self を表すテキストが最後に現れる列番号を返します。

列番号は0-originで、バイト単位で表されます。

//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 1')
p node.last_column # => 5
//}...

RubyVM::AbstractSyntaxTree::Node#last_lineno -> Integer (9108.0)

ソースコード中で、self を表すテキストが最後に現れる行番号を返します。

...ソースコード中で、self を表すテキストが最後に現れる行番号を返します。

行番号は1-originです。

//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 1')
p node.last_lineno # => 1
//}...

絞り込み条件を変える

Enumerator::Lazy#take_while -> Enumerator::Lazy (3113.0)

Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。

...rator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>:take_while>

1.step.lazy.zip(('a'..'z').cycle).take_...
...while { |e| e.first < 100_000 }.force.last(5)
# => [[99995, "y"], [99996, "z"], [99997, "a"], [99998, "b"], [99999, "c"]]
//}

@see Enumerable#take_while...

Enumerator::Lazy#take_while {|item| ... } -> Enumerator::Lazy (3113.0)

Enumerable#take_while と同じですが、配列ではなくEnumerator::Lazy を返します。

...rator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle).take_while { |e| e.first < 100_000 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:zip(#<Enumerator: "a".."z":cycle>)>:take_while>

1.step.lazy.zip(('a'..'z').cycle).take_...
...while { |e| e.first < 100_000 }.force.last(5)
# => [[99995, "y"], [99996, "z"], [99997, "a"], [99998, "b"], [99999, "c"]]
//}

@see Enumerable#take_while...

Enumerator::Lazy#zip(*lists) -> Enumerator::Lazy (3113.0)

Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。

...ではなくEnumerator::Lazy を返します。

ただし一貫性のため、ブロック付きで呼び出した場合は Enumerable#zip と
同じ挙動になります。

//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:z...
...ip(#<Enumerator: "a".."z":cycle>)>

1.step.lazy.zip(('a'..'z').cycle).take(30).force.last(6)
# => [[25, "y"], [26, "z"], [27, "a"], [28, "b"], [29, "c"], [30, "d"]]
//}

@see Enumerable#zip...

Array#first(n) -> Array (3108.0)

先頭の n 要素を配列で返します。n は 0 以上でなければなりません。

...TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

@raise ArgumentError n が負値の場合発生します。

//emlist[例][ruby]{
ary = [0, 1, 2]
p ary.first(0)
p ary.first(1)
p ary.first(2)
p ary....
...first(3)
p ary.first(4)
# => []
# [0]
# [0, 1]
# [0, 1, 2]
# [0, 1, 2]
//}

@see Array#last...

Enumerator::Lazy#zip(*lists) {|v1, v2, ...| ... } -> nil (3013.0)

Enumerable#zip と同じですが、配列ではなくEnumerator::Lazy を返します。

...ではなくEnumerator::Lazy を返します。

ただし一貫性のため、ブロック付きで呼び出した場合は Enumerable#zip と
同じ挙動になります。

//emlist[例][ruby]{
1.step.lazy.zip(('a'..'z').cycle)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:z...
...ip(#<Enumerator: "a".."z":cycle>)>

1.step.lazy.zip(('a'..'z').cycle).take(30).force.last(6)
# => [[25, "y"], [26, "z"], [27, "a"], [28, "b"], [29, "c"], [30, "d"]]
//}

@see Enumerable#zip...

絞り込み条件を変える

<< 1 2 > >>