12件ヒット
[1-12件を表示]
(0.011秒)
検索結果
-
Object
# ==(other) -> bool (23001.0) -
オブジェクトと other が等しければ真を返します。
...。
デフォルトでは equal? と同じオブジェクト
の同一性判定になっています。
@param other 比較するオブジェクトです。
p("foo" == "bar") #=> false
p("foo" == "foo") #=> true
p(4 == 4) #=> true
p(4 == 4.0) #=> true
@see Object#equal?,Object#eql?... -
Object
# ===(other) -> bool (3001.0) -
メソッド Object#== の別名です。 case 式で使用されます。このメソッドは case 式での振る舞いを考慮して、 各クラスの性質に合わせて再定義すべきです。
...メソッド Object#== の別名です。
case 式で使用されます。このメソッドは case 式での振る舞いを考慮して、
各クラスの性質に合わせて再定義すべきです。
一般的に所属性のチェックを実現するため適宜再定義されます。
when......s. 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...