55件ヒット
[1-55件を表示]
(0.012秒)
検索結果
先頭5件
-
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...