3件ヒット
[1-3件を表示]
(0.033秒)
検索結果
-
Object
# ===(other) -> bool (54376.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
# clone(freeze: true) -> object (40.0) -
オブジェクトの複製を作成して返します。
..._d) #=> true
p(obj_d.tainted?) #=> true
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの... -
Object
# dup -> object (40.0) -
オブジェクトの複製を作成して返します。
..._d) #=> true
p(obj_d.tainted?) #=> true
p(obj_d.frozen?) #=> false
p(obj_d.respond_to?(:fuga)) #=> false
//}
@see Object#initialize_copy
=== 深いコピーと浅いコピー
clone や dup はオブジェクト自身を複製するだけで、オブジェクトの...