るりまサーチ

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

別のキーワード

  1. csv instance
  2. prime instance
  3. syslog instance
  4. _builtin instance_eval
  5. singleton instance

ライブラリ

検索結果

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

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

... Object#== を呼び出します。

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

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

@param other 比較するオブジェクトです。

//emlist[][ruby]{
age = 12
# (0..2).===(12), (3..6).===(12...
..."Instance of 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#===, En...