359件ヒット
[1-100件を表示]
(0.064秒)
別のキーワード
クラス
- Binding (86)
- ERB (28)
-
IRB
:: Frame (60) - Object (12)
- Proc (12)
- Socket (12)
- Thread (12)
- TracePoint (12)
- Tracer (24)
モジュール
- Kernel (12)
-
Socket
:: Constants (12)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - Binding (12)
-
IP
_ FREEBIND (24) -
NEWS for Ruby 3
. 0 . 0 (5) -
TOPLEVEL
_ BINDING (12) -
add
_ filter (12) - backtrace (12)
- bottom (24)
- eval (12)
- irb (9)
-
local
_ variable _ defined? (12) -
local
_ variable _ get (12) -
local
_ variable _ set (12) -
local
_ variables (11) - new (4)
-
proc
_ binding (12) -
rb
_ f _ binding (12) - receiver (11)
- result (12)
-
ruby 1
. 6 feature (12) - run (12)
-
source
_ location (7) - top (24)
-
trace
_ func (24) - パターンマッチ (12)
検索結果
先頭5件
-
Kernel
. # binding -> Binding (24430.0) -
変数・メソッドなどの環境情報を含んだ Binding オブジェクトを 生成して返します。通常、Kernel.#eval の第二引数として使います。
...変数・メソッドなどの環境情報を含んだ Binding オブジェクトを
生成して返します。通常、Kernel.#eval の第二引数として使います。
//emlist[例][ruby]{
def foo
a = 1
binding
end
eval("p a", foo) #=> 1
//}
@see Kernel.#eval,Object::TOPLEVEL_BINDING... -
TracePoint
# binding -> Binding | nil (24430.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
//}... -
Proc
# binding -> Binding (24424.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 (24424.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
//}... -
Binding
# local _ variable _ get(symbol) -> object (15130.0) -
引数 symbol で指定した名前のローカル変数に設定された値を返します。
...][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?... -
Object
:: TOPLEVEL _ BINDING -> Binding (12424.0) -
トップレベルでの Binding オブジェクト。
...トップレベルでの Binding オブジェクト。
詳細は Binding を参照してください。... -
static VALUE proc
_ binding(VALUE proc) (12200.0) -
-
static VALUE rb
_ f _ binding(VALUE self) (12200.0) -
-
Binding
# source _ location -> [String , Integer] (12106.0) -
self の Ruby のソースファイル名と行番号を返します。
...self の Ruby のソースファイル名と行番号を返します。
d:spec/variables#pseudo の __FILE__ と __LINE__ も参照してください。
//emlist[例][ruby]{
p binding.source_location # => ["test.rb", 1]
//}... -
Binding
# local _ variable _ defined?(symbol) -> bool (12030.0) -
引数 symbol で指定した名前のローカル変数が定義されている場合に true を、 そうでない場合に false を返します。
...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...