204件ヒット
[1-100件を表示]
(0.023秒)
別のキーワード
種類
- インスタンスメソッド (102)
- 文書 (54)
- 関数 (24)
- クラス (24)
ライブラリ
- ビルトイン (126)
クラス
- Binding (30)
- Method (36)
- Module (12)
- UnboundMethod (24)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - === (6)
- Binding (12)
-
NEWS for Ruby 2
. 7 . 0 (6) - UnboundMethod (12)
- [] (6)
-
bind
_ call (12) -
bind
_ clone (12) - call (12)
- eval (12)
-
instance
_ method (12) -
rb
_ f _ binding (12) - receiver (11)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) -
source
_ location (7) - unbind (12)
検索結果
先頭5件
-
UnboundMethod
# bind(obj) -> Method (18147.0) -
self を obj にバインドした Method オブジェクトを生成して返します。
...
self を obj にバインドした Method オブジェクトを生成して返します。
@param obj 自身をバインドしたいオブジェクトを指定します。ただしバインドできるのは、
生成元のクラスかそのサブクラスのインスタンスのみで......す。
@raise TypeError objがbindできないオブジェクトである場合に発生します
//emlist[例][ruby]{
# クラスのインスタンスメソッドの UnboundMethod の場合
class Foo
def foo
"foo"
end
end
# UnboundMethod `m' を生成
p m = Foo.instance_method(:foo) # =>......スをレシーバとする Method オブジェクトを生成
p m.bind(Foo.new) # => #<Method: Foo#foo>
# Foo のサブクラス Bar のインスタンスをレシーバとする Method
class Bar < Foo
end
p m.bind(Bar.new) # => #<Method: Bar(Foo)#foo>
# モジュー... -
static VALUE bind
_ clone(VALUE self) (6200.0) -
-
static VALUE rb
_ f _ binding(VALUE self) (6200.0) -
-
UnboundMethod
# bind _ call(recv , *args) -> object (6158.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... -
UnboundMethod
# bind _ call(recv , *args) { . . . } -> object (6158.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... -
Method
# unbind -> UnboundMethod (6122.0) -
self のレシーバとの関連を取り除いた UnboundMethod オブ ジェクトを生成して返します。
...
self のレシーバとの関連を取り除いた UnboundMethod オブ
ジェクトを生成して返します。
//emlist[例][ruby]{
class Foo
def foo
"foo"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
unbound_method = m.unbind # => #<UnboundMethod: Foo#foo>
unbound_method.......bind(Foo.new) # => #<Method: Foo#foo>
//}... -
Binding (6016.0)
-
ローカル変数のテーブルと self、モジュールのネストなどの情報を保 持するオブジェクトのクラスです。
...ーブルと self、モジュールのネストなどの情報を保
持するオブジェクトのクラスです。
組み込み関数 Kernel.#binding と Proc#binding によっ
てのみ生成され、Kernel.#eval の第 2 引数に使用します。
またトップレベルの Binding オブジ......ェクトとして組み込み定数
Object::TOPLEVEL_BINDING が用意されています。... -
Binding
# receiver -> object (3022.0) -
保持するコンテキスト内での self を返します。
...保持するコンテキスト内での self を返します。
このメソッドは以下のコードと同様の動作をします。
//emlist[][ruby]{
binding.eval("self")
//}... -
Binding
# eval(expr , fname = _ _ FILE _ _ , lineno = 1) -> object (3016.0) -
自身をコンテキストとし文字列 expr を Ruby プログラムとして評価しその結果を返します。 組み込み関数 Kernel.#eval を使って eval(expr, self, fname, lineno) とするのと同じです。
...し文字列 expr を
Ruby プログラムとして評価しその結果を返します。
組み込み関数 Kernel.#eval を使って
eval(expr, self, fname, lineno) とするのと同じです。
@param expr 評価したい式を文字列で与えます。
@param fname ファイル名を文字......の先頭行の行番号が lineno であるかのように実行されます。
//emlist[例][ruby]{
def get_binding(str)
binding
end
str = "hello"
p eval("str + ' Fred'") #=> "hello Fred"
p get_binding("bye").eval("str + ' Fred'") #=> "bye Fred"
//}
@see Kernel.#eval... -
Binding
# source _ location -> [String , Integer] (3016.0) -
self の Ruby のソースファイル名と行番号を返します。
...
self の Ruby のソースファイル名と行番号を返します。
d:spec/variables#pseudo の __FILE__ と __LINE__ も参照してください。
//emlist[例][ruby]{
p binding.source_location # => ["test.rb", 1]
//}...