るりまサーチ

最速Rubyリファレンスマニュアル検索!
251件ヒット [1-100件を表示] (0.085秒)
トップページ > クエリ:@[x] > クエリ:y[x] > クエリ:last[x]

別のキーワード

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

検索結果

<< 1 2 3 > >>

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

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

...上でなければなりません。

@
param n 取得したい要素の個数を整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。

@
raise 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 (21129.0)

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

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

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

@
see Array#first...

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

@todo

...@todo...

Hash.ruby2_keywords_hash?(hash) -> bool (6112.0)

Module#ruby2_keywordsやProc#ruby2_keywordsによる ruby2_keywords フラグが設定されているかどうかを返します。

...Module#ruby2_keywordsやProc#ruby2_keywordsによる
ruby2_keywords フラグが設定されているかどうかを返します。

このメソッドはデバッグや調査、シリアライゼーションのために本当に必要な場合のために
用意されていて、普通のプログ...
...れていません。

ruby 2.7.1 で追加されたため、ruby 2.7.0 では定義されていません。

//emlist[][ruby]{
ruby2_keywords def foo(*args)
Hash.ruby2_keywords_hash?(args.last)
end
foo(k: 1) # => true
foo({k: 1}) # => false
//}

@
see Module#ruby2_keywords, Proc#ruby2_keywords...

ruby 1.8.4 feature (3432.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...ruby 1.8.4 feature
ruby 1.8.4 での ruby 1.8.3 からの変更点です。

掲載方針

*バグ修正の影響も含めて動作が変わるものを収録する。
*単にバグを直しただけのものは収録しない。
*ライブラリへの単なる定数の追加は収録しない。...
...ty symbol literal

p :"#{""}"

# => ruby 1.8.3 (2005-09-21) [i686-linux]
:
# => ruby 1.8.4 (2005-12-16) [i686-linux]
-:1: empty symbol literal

: Symbol [bug]

#Sat Oct 22 13:26:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
#
# * object.c (sy...
...e Nov 01 10:50:17 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
#
# * ext/openssl/extconf.rb: should check ERR_peek_last_error().
# [ruby-dev:27597]
#
# * ext/openssl/ossl.c (ossl_raise): ditto.
#
# ?

#Mon Oct 31 05:49:23 2005 GOTOU Yuuzou <gotoyuzo@notwork.org>
#
# * ext...

絞り込み条件を変える

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

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

...上でなければなりません。

@
param n 取得したい要素の個数を整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。

@
raise 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#take_while -> Enumerator::Lazy (3118.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 (3118.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 (3118.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...

ruby 1.6 feature (3060.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...ruby 1.6 feature
ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。

((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。

== 1.6.8 (2002-12-24) ->...
...。((<ruby-bugs-ja:PR#216>))

Object.new.instance_eval {
p remove_instance_variable :@foo
}
=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil

=> -:2:in `remove_instance_variable': instance variable @foo not defined (NameError)
ruby 1.6.7 (20...
...thod (SecurityError)
ruby 1.6.4 (2001-08-06) [i586-linux]

対応するChangeLogは以下のようです。

Tue Jun 5 15:16:06 2001 Yukihiro Matsumoto <matz@ruby-lang.org>

* eval.c (rb_add_method): should not call rb_secure(), for
last
_func may not be set....

絞り込み条件を変える

<< 1 2 3 > >>