るりまサーチ

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

別のキーワード

  1. string []=
  2. string slice!
  3. string slice
  4. string []
  5. string gsub!

ライブラリ

キーワード

検索結果

UnboundMethod#inspect -> String (6221.0)

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

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

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

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

@see Method#inspect...

UnboundMethod#to_s -> String (6221.0)

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

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

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

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

@see Method#inspect...

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

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

...nil を返します。

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

T
ime.instance_method(:zone).source_location # => nil
T
ime.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 (6185.0)

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

...t[例][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(:two).arity #=> 1
p C.instance_method(:three).arity #=> -1
p C.inst...
...e_method(:four).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...

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

自身と other が同じクラスあるいは同じモジュールの同じメソッドを表す場合に true を返します。そうでない場合に false を返します。

...other が同じクラスあるいは同じモジュールの同じメソッドを表す場合に
t
rue を返します。そうでない場合に false を返します。

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

//emlist[例][ruby]{
a = String.instance_method(:s...
...ize)
b = String.instance_method(:size)
p a == b #=> true

c = Array.instance_method(:size)
p a == c #=> false
//}...

絞り込み条件を変える

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

自身と other が同じクラスあるいは同じモジュールの同じメソッドを表す場合に true を返します。そうでない場合に false を返します。

...other が同じクラスあるいは同じモジュールの同じメソッドを表す場合に
t
rue を返します。そうでない場合に false を返します。

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

//emlist[例][ruby]{
a = String.instance_method(:s...
...ize)
b = String.instance_method(:size)
p a == b #=> true

c = Array.instance_method(:size)
p a == c #=> false
//}...

UnboundMethod#clone -> UnboundMethod (3113.0)

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

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

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

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

UnboundMethod#name -> Symbol (3013.0)

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

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

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