るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

ライブラリ

キーワード

検索結果

<< 1 2 > >>

UnboundMethod#super_method -> UnboundMethod | nil (9201.0)

self 内で super を実行した際に実行されるメソッドを UnboundMethod オブジェ クトにして返します。

...self 内で super を実行した際に実行されるメソッドを UnboundMethod オブジェ
クトにして返します。


@see Method#super_method...

UnboundMethod#arity -> Integer (6101.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#inspect -> String (6101.0)

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

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

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

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

@see Method#inspect...

UnboundMethod#parameters -> [object] (6101.0)

UnboundMethod オブジェクトの引数の情報を返します。

...
UnboundMethod
オブジェクトの引数の情報を返します。

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



@see Proc#parameters, Method#parameters...

UnboundMethod#source_location -> [String, Integer] | nil (6101.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#to_s -> String (6101.0)

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

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

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

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

@see Method#inspect...

UnboundMethod#==(other) -> bool (3101.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#bind(obj) -> Method (3101.0)

self を obj にバインドした Method オブジェクトを生成して返します。

...した Method オブジェクトを生成して返します。


@param obj 自身をバインドしたいオブジェクトを指定します。ただしバインドできるのは、
生成元のクラスかそのサブクラスのインスタンスのみです。

@raise TypeError obj...
...

//emlist[例][ruby]{
# クラスのインスタンスメソッドの UnboundMethod の場合
class Foo
def foo
"foo"
end
end

# UnboundMethod `m' を生成
p m = Foo.instance_method(:foo) # => #<UnboundMethod: Foo#foo>

# Foo のインスタンスをレシーバとする Method オブ...
...w) # => #<Method: Foo#foo>

# Foo のサブクラス Bar のインスタンスをレシーバとする Method
class Bar < Foo
end
p m.bind(Bar.new) # => #<Method: Bar(Foo)#foo>


# モジュールのインスタンスメソッドの UnboundMethod の場合
module Foo
de...

UnboundMethod#bind_call(recv, *args) -> object (3101.0)

self を recv に bind して args を引数として呼び出します。

...self を recv に bind して args を引数として呼び出します。

self.bind(recv).call(*args) と同じ意味です。

//emlist[][ruby]{
puts Kernel.instance_method(:inspect).bind_call(BasicObject.new) # => #<BasicObject:0x000055c65e8ea7b8>
//}

@see UnboundMethod#bind, Method#call...
<< 1 2 > >>