4件ヒット
[1-4件を表示]
(0.084秒)
ライブラリ
- ビルトイン (4)
クラス
- Method (2)
- UnboundMethod (2)
検索結果
先頭4件
-
UnboundMethod
# eql?(other) -> bool (45358.0) -
自身と other が同じクラスあるいは同じモジュールの同じメソッドを表す場合に true を返します。そうでない場合に false を返します。
自身と other が同じクラスあるいは同じモジュールの同じメソッドを表す場合に
true を返します。そうでない場合に false を返します。
@param other 自身と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
a = String.instance_method(:size)
b = String.instance_method(:size)
p a == b #=> true
c = Array.instance_method(:size)
p a == c ... -
Method
# eql?(other) -> bool (45340.0) -
自身と other が同じインスタンスの同じメソッドを表す場合に true を返します。そうでない場合に false を返します。
自身と other が同じインスタンスの同じメソッドを表す場合に
true を返します。そうでない場合に false を返します。
@param other 自身と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
s = "bar"
a = s.method(:size)
b = s.method(:size)
p a == b #=> true
//} -
Method
# hash -> Integer (40.0) -
自身のハッシュ値を返します。
自身のハッシュ値を返します。
//emlist[例][ruby]{
a = method(:==)
b = method(:eql?)
p a.eql? b # => true
p a.hash == b.hash # => true
p [a, b].uniq.size # => 1
//} -
UnboundMethod
# hash -> Integer (40.0) -
自身のハッシュ値を返します。
自身のハッシュ値を返します。
//emlist[例][ruby]{
a = method(:==).unbind
b = method(:eql?).unbind
p a.eql? b # => true
p a.hash == b.hash # => true
p [a, b].uniq.size # => 1
//}