るりまサーチ (Ruby 2.3.0)

最速Rubyリファレンスマニュアル検索!
5件ヒット [1-5件を表示] (0.020秒)
トップページ > クエリ:Enumerable[x] > クラス:Object[x] > バージョン:2.3.0[x]

別のキーワード

  1. enumerable max
  2. enumerable min
  3. enumerable max_by
  4. enumerable min_by
  5. enumerable count

ライブラリ

キーワード

検索結果

Object#===(other) -> bool (40.0)

case 式で使用されるメソッドです。d:spec/control#case も参照してください。

...ドは case 式での振る舞いを考慮して、
各クラスの性質に合わせて再定義すべきです。

デフォルトでは内部で Object#== を呼び出します。

when 節の式をレシーバーとして === を呼び出すことに注意してください。

また Enumerable...
...String class. But don't hit."
else
"unknown"
end
end

puts check([]) #=> unknown
puts check("mash-up in Ruby on Rails") #=> instance of String class. But not hit...
puts check("<Ruby's world>") #=> hit! <Ruby's world>
//}

@see Object#==, Range#===, Module#===, Regexp#===, Enumerable#grep...

Object#enum_for(method = :each, *args) -> Enumerator (22.0)

Enumerator.new(self, method, *args) を返します。

Enumerator.new(self, method, *args) を返します。

ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

#...

Object#enum_for(method = :each, *args) {|*args| ... } -> Enumerator (22.0)

Enumerator.new(self, method, *args) を返します。

Enumerator.new(self, method, *args) を返します。

ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

#...

Object#to_enum(method = :each, *args) -> Enumerator (22.0)

Enumerator.new(self, method, *args) を返します。

Enumerator.new(self, method, *args) を返します。

ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

#...

Object#to_enum(method = :each, *args) {|*args| ... } -> Enumerator (22.0)

Enumerator.new(self, method, *args) を返します。

Enumerator.new(self, method, *args) を返します。

ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。


@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

#...

絞り込み条件を変える