るりまサーチ

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

別のキーワード

  1. string b
  2. _builtin b
  3. b
  4. b _builtin

ライブラリ

キーワード

検索結果

UnboundMethod#==(other) -> bool (3125.0)

自身と 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 #=>...

UnboundMethod#eql?(other) -> bool (3125.0)

自身と 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 #=>...

UnboundMethod#clone -> UnboundMethod (3119.0)

自身を複製した UnboundMethod オブジェクトを作成して返します。

...自身を複製した UnboundMethod オブジェクトを作成して返します。

//emlist[例][ruby]{
a = String.instance_method(:size)
b
= a.clone

a == b # => true
//}...

UnboundMethod#inspect -> String (3115.0)

self を読みやすい文字列として返します。

...self を読みやすい文字列として返します。

詳しくは Method#inspect を参照してください。

//emlist[例][ruby]{
String
.instance_method(:count).inspect # => "#<UnboundMethod: String#count>"
//}

@see Method#inspect...

UnboundMethod#to_s -> String (3115.0)

self を読みやすい文字列として返します。

...self を読みやすい文字列として返します。

詳しくは Method#inspect を参照してください。

//emlist[例][ruby]{
String
.instance_method(:count).inspect # => "#<UnboundMethod: String#count>"
//}

@see Method#inspect...

絞り込み条件を変える

UnboundMethod#name -> Symbol (3107.0)

このメソッドの名前を返します。

...このメソッドの名前を返します。

//emlist[例][ruby]{
a = String.instance_method(:size)
a.name # => :size
//}...

UnboundMethod#source_location -> [String, Integer] | nil (3102.0)

ソースコードのファイル名と行番号を配列で返します。

...ruby で定義されていない(つまりネイティブ
である)場合は nil を返します。

//emlist[例][ruby]{
require 'time'

Time.instance_method(:zone).source_location # => nil
Time.instance_method(:httpdate).source_location # => ["/Users/user/.rbenv/versions/2.4.3/lib/ruby/2...
....4.0/time.rb", 654]
//}

@see Proc#source_location, Method#source_location...

UnboundMethod#arity -> Integer (3043.0)

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

...可変長引数を
受け付ける場合、-1 を返します。

//emlist[例][ruby]{
class C
def one; end
def two(a); end
def three(*a); end
def four(a, b); end
def five(a, b, *c); end
def six(a, b, *c, &d); end
end

p C.instance_method(:one).arity #=> 0
p C.instance_method(...
...).arity #=> 2
p C.instance_method(:five).arity #=> -3
p C.instance_method(:six).arity #=> -3


String
.instance_method(:size).arity #=> 0
String
.instance_method(:replace).arity #=> 1
String
.instance_method(:squeeze).arity #=> -1
String
.instance_method(:count).arity #=> -1
//}...