るりまサーチ

最速Rubyリファレンスマニュアル検索!
48件ヒット [1-48件を表示] (0.101秒)

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. dsa p
  5. rsa p

ライブラリ

キーワード

検索結果

Method#arity -> Integer (44.0)

メソッドが受け付ける引数の数を返します。

...nd

c = C.new
p
c.method(:u).arity #=> 0
p
c.method(:v).arity #=> 1
p
c.method(:w).arity #=> -1
p
c.method(:x).arity #=> 2
p
c.method(:y).arity #=> -3
p
c.method(:z).arity #=> -3

s = "xyz"
s.method(:size).arity #=> 0
s.method(:replace).arity #=> 1
s.method(:squeeze).a...
...rity #=> -1
s.method(:count).arity #=> -1
//}...

Method#hash -> Integer (26.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
//}...

Method#==(other) -> bool (20.0)

自身と other が同じインスタンスの同じメソッドを表す場合に true を返します。そうでない場合に false を返します。

...ッドを表す場合に
true を返します。そうでない場合に false を返します。

@param other 自身と比較したいオブジェクトを指定します。

//emlist[例][ruby]{
s = "bar"
a = s.method(:size)
b = s.method(:size)
p
a == b #=> true
//}...

Method#eql?(other) -> bool (20.0)

自身と other が同じインスタンスの同じメソッドを表す場合に true を返します。そうでない場合に false を返します。

...ッドを表す場合に
true を返します。そうでない場合に false を返します。

@param other 自身と比較したいオブジェクトを指定します。

//emlist[例][ruby]{
s = "bar"
a = s.method(:size)
b = s.method(:size)
p
a == b #=> true
//}...