11件ヒット
[1-11件を表示]
(0.014秒)
ライブラリ
- ビルトイン (11)
検索結果
-
BasicObject
# ==(other) -> bool (3001.0) -
オブジェクトが other と等しければ真を、さもなくば偽を返します。
...[ruby]{
class Person < BasicObject
def initialize(name, age)
@name = name
@age = age
end
end
tanaka1 = Person.new("tanaka", 24)
tanaka2 = Person.new("tanaka", 24)
tanaka1 == tanaka1 #=> true
tanaka1 == tanaka2 #=> false
//}
@see BasicObject#equal?, Object#==, Object#equal?,...