るりまサーチ

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

別のキーワード

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

ライブラリ

キーワード

検索結果

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

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

...に合わせて再定義すべきです。

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

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

また Enumerable#grep でも使用されます。

@param other 比較するオブジェ...
...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 (7.0)

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

...m being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}

//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat...

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

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

...m being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}

//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat...

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

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

...m being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}

//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat...

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

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

...m being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}

//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat...

絞り込み条件を変える