別のキーワード
ライブラリ
- ビルトイン (141)
- e2mmap (6)
- erb (22)
-
fiddle
/ import (11) -
irb
/ frame (33) -
irb
/ xmp (11) - resolv-replace (11)
-
rubygems
/ specification (22) - socket (110)
- tracer (11)
- un (11)
クラス
- Addrinfo (22)
- Binding (67)
- ERB (22)
-
Gem
:: Specification (22) - IPSocket (11)
-
IRB
:: Frame (33) - Method (31)
- Module (11)
- Socket (33)
-
Socket
:: AncillaryData (11) - TracePoint (11)
- Tracer (11)
- UDPSocket (44)
- UnboundMethod (21)
モジュール
- Exception2MessageMapper (6)
-
Fiddle
:: Importer (11) - Kernel (22)
キーワード
- === (5)
- [] (5)
- accept (11)
-
add
_ bindir (11) -
bind
_ call (10) - binding (11)
- bindir (11)
- bottom (11)
- call (10)
- connect (11)
- eval (11)
- httpd (11)
-
instance
_ method (11) - irb (8)
-
local
_ variable _ defined? (11) -
local
_ variable _ get (11) -
local
_ variables (10) - receiver (10)
- recvfrom (22)
-
recvfrom
_ nonblock (11) - result (11)
- run (11)
-
source
_ location (6) - top (11)
-
trace
_ func (22) - unbind (11)
- xmp (11)
検索結果
先頭5件
-
Method
# unbind -> UnboundMethod (9325.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
# receiver -> object (9301.0) -
保持するコンテキスト内での self を返します。
...保持するコンテキスト内での self を返します。
このメソッドは以下のコードと同様の動作をします。
//emlist[][ruby]{
binding.eval("self")
//}... -
Gem
:: Specification # add _ bindir(executables) -> Array | nil (9301.0) -
実行コマンドの格納場所を返します。
...実行コマンドの格納場所を返します。
@param executables 実行コマンド名を格納した配列を指定します。... -
TracePoint
# binding -> Binding (9301.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 (9301.0) -
発生したイベントによって生成された Binding オブジェクトを返します。
...た Binding オブジェクトを返します。
C で記述されたメソッドは binding を生成しないため、
:c_call および :c_return イベントに対しては nil を返すことに注意してください。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.new(:cal......l) do |tp|
p tp.binding.local_variables # => [:ret]
end
trace.enable
foo 1
//}... -
Binding
# eval(expr , fname = _ _ FILE _ _ , lineno = 1) -> object (9201.0) -
自身をコンテキストとし文字列 expr を Ruby プログラムとして評価しその結果を返します。 組み込み関数 Kernel.#eval を使って eval(expr, self, fname, lineno) とするのと同じです。
...トとし文字列 expr を
Ruby プログラムとして評価しその結果を返します。
組み込み関数 Kernel.#eval を使って
eval(expr, self, fname, lineno) とするのと同じです。
@param expr 評価したい式を文字列で与えます。
@param fname ファイル名を......式 expr が fname というファイル名にあるかのように実行されます。
@param lineno 行番号を整数で与えます。式 expr の先頭行の行番号が 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
# local _ variable _ defined?(symbol) -> bool (9201.0) -
引数 symbol で指定した名前のローカル変数が定義されている場合に true を、 そうでない場合に false を返します。
...に true を、
そうでない場合に false を返します。
@param symbol ローカル変数名を Symbol オブジェクトで指定します。
//emlist[例][ruby]{
def foo
a = 1
binding.local_variable_defined?(:a) # => true
binding.local_variable_defined?(:b) # => false
end
//}
こ......のメソッドは以下のコードの短縮形です。
//emlist[][ruby]{
binding.eval("defined?(#{symbol}) == 'local-variable'")
//}
@see Binding#local_variable_get, Binding#local_variable_set... -
Binding
# local _ variable _ get(symbol) -> object (9201.0) -
引数 symbol で指定した名前のローカル変数に設定された値を返します。
...クトで指定します。
@raise NameError 引数 symbol で指定したローカル変数が未定義の場合に発生します。
//emlist[例][ruby]{
def foo
a = 1
binding.local_variable_get(:a) # => 1
binding.local_variable_get(:b) # => NameError
end
//}
このメソッドは以下......のコードの短縮形です。
//emlist[][ruby]{
binding.eval("#{symbol}")
//}
@see Binding#local_variable_set, Binding#local_variable_defined?... -
Binding
# local _ variables -> [Symbol] (9201.0) -
ローカル変数の一覧を Symbol の配列で返します。
...カル変数の一覧を Symbol の配列で返します。
//emlist[例][ruby]{
def foo
a = 1
2.times do |n|
binding.local_variables #=> [:a, :n]
end
end
//}
このメソッドは以下のコードと同様の動作をします。
//emlist[][ruby]{
binding.eval("local_variables")
//}... -
Binding
# source _ location -> [String , Integer] (9201.0) -
self の Ruby のソースファイル名と行番号を返します。
...self の Ruby のソースファイル名と行番号を返します。
d:spec/variables#pseudo の __FILE__ と __LINE__ も参照してください。
//emlist[例][ruby]{
p binding.source_location # => ["test.rb", 1]
//}... -
Gem
:: Specification # bindir -> String (9201.0) -
実行ファイルを格納するディレクトリを返します。
実行ファイルを格納するディレクトリを返します。 -
IRB
:: Frame # trace _ func(event , file , line , id , binding) -> Binding (6401.0) -
ライブラリ内部で使用します。
ライブラリ内部で使用します。