ライブラリ
- ビルトイン (182)
- e2mmap (6)
- erb (24)
-
fiddle
/ import (12) -
irb
/ frame (36) -
irb
/ xmp (12) - resolv-replace (12)
-
rubygems
/ installer (36) -
rubygems
/ specification (36) - socket (120)
- tracer (12)
- un (12)
クラス
- Addrinfo (24)
- Binding (86)
- ERB (24)
-
Gem
:: Installer (36) -
Gem
:: Specification (36) - IPSocket (12)
-
IRB
:: Frame (36) - Method (36)
- Module (12)
- Proc (12)
- Socket (36)
-
Socket
:: AncillaryData (12) - TracePoint (12)
- Tracer (12)
- UDPSocket (48)
- UnboundMethod (24)
モジュール
- Exception2MessageMapper (6)
-
Fiddle
:: Importer (12) - Kernel (24)
キーワード
- === (6)
- [] (6)
- accept (12)
-
add
_ bindir (12) -
bind
_ call (12) - binding (24)
- bindir (12)
- bindir= (12)
- bottom (12)
- call (12)
- connect (12)
- eval (12)
-
generate
_ bin _ script (12) -
generate
_ bin _ symlink (12) -
generate
_ windows _ script (12) - httpd (12)
-
instance
_ method (12) - irb (9)
-
local
_ variable _ defined? (12) -
local
_ variable _ get (12) -
local
_ variable _ set (12) -
local
_ variables (11) - receiver (11)
- recvfrom (24)
-
recvfrom
_ nonblock (12) - result (12)
- run (12)
-
source
_ location (7) - top (12)
-
trace
_ func (24) - unbind (12)
- xmp (12)
検索結果
先頭5件
-
Proc
# binding -> Binding (6201.0) -
Proc オブジェクトが保持するコンテキストを Binding オブジェクトで返します。
...Proc オブジェクトが保持するコンテキストを
Binding オブジェクトで返します。
//emlist[例][ruby]{
def fred(param)
proc {}
end
sample_proc = fred(99)
eval("param", sample_proc.binding) # => 99
//}... -
TracePoint
# binding -> Binding (6201.0) -
発生したイベントによって生成された Binding オブジェクトを返します。
...発生したイベントによって生成された Binding オブジェクトを返します。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.binding.local_variables # => [:ret]
end
trace.enable
foo 1
//}... -
TracePoint
# binding -> Binding | nil (6201.0) -
発生したイベントによって生成された Binding オブジェクトを返します。
...発生したイベントによって生成された Binding オブジェクトを返します。
C で記述されたメソッドは binding を生成しないため、
:c_call および :c_return イベントに対しては nil を返すことに注意してください。
//emlist[例][ruby]{
d......ef foo(ret)
ret
end
trace = TracePoint.new(:call) do |tp|
p tp.binding.local_variables # => [:ret]
end
trace.enable
foo 1
//}... -
UnboundMethod
# bind _ call(recv , *args) -> object (6137.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 (6137.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 (6107.0) -
self のレシーバとの関連を取り除いた UnboundMethod オブ ジェクトを生成して返します。
...いた 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>
//}... -
Gem
:: Specification # add _ bindir(executables) -> Array | nil (6101.0) -
実行コマンドの格納場所を返します。
実行コマンドの格納場所を返します。
@param executables 実行コマンド名を格納した配列を指定します。 -
Gem
:: Specification # bindir -> String (6101.0) -
実行ファイルを格納するディレクトリを返します。
実行ファイルを格納するディレクトリを返します。 -
Gem
:: Specification # bindir=(dir) (6101.0) -
実行ファイルを格納するディレクトリをセットします。
実行ファイルを格納するディレクトリをセットします。
@param dir 実行ファイルを格納するディレクトリを指定します。デフォルトは "bin" です。 -
Binding
# local _ variable _ set(symbol , obj) (3031.0) -
引数 symbol で指定した名前のローカル変数に引数 obj を設定します。
...by]{
def foo
a = 1
bind = binding
bind.local_variable_set(:a, 2) # set existing local variable `a'
bind.local_variable_set(:b, 3) # create new local variable `b'
# `b' exists only in binding
p bind.local_variable_get(:a) # => 2
p bind.local_variable_get(......# => NameError
end
//}
このメソッドは以下のコード(ただし、obj が Ruby のコードで出力される場
合)と同様の動作をします。
//emlist[][ruby]{
binding.eval("#{symbol} = #{obj}")
//}
@see Binding#local_variable_get, Binding#local_variable_defined?... -
Binding
# eval(expr , fname = _ _ FILE _ _ , lineno = 1) -> object (3001.0) -
自身をコンテキストとし文字列 expr を Ruby プログラムとして評価しその結果を返します。 組み込み関数 Kernel.#eval を使って eval(expr, self, fname, lineno) とするのと同じです。
...の先頭行の行番号が 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
# irb -> object (3001.0) -
REPLのセッションを開始します。
...REPLのセッションを開始します。
2.5.0 からは require 'irb' せずに直接 binding.irb を呼び出しても使えるようになりました。
@see irb...