654件ヒット
[1-100件を表示]
(0.097秒)
ライブラリ
クラス
- Binding (86)
- ERB (36)
-
IRB
:: Frame (60) - Proc (12)
-
RubyVM
:: InstructionSequence (12) - Socket (12)
- Thread (54)
- TracePoint (24)
- Tracer (36)
モジュール
- Kernel (60)
- ObjectSpace (36)
-
Socket
:: Constants (12)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - Context (12)
-
IP
_ FREEBIND (24) -
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) - Ruby プログラムの実行 (12)
-
add
_ filter (24) -
add
_ trace _ func (12) - backtrace (12)
- bottom (24)
-
count
_ tdata _ objects (12) -
define
_ finalizer (24) - eval (36)
- irb (21)
-
irb
/ xmp (12) -
local
_ variable _ defined? (12) -
local
_ variable _ get (12) -
local
_ variable _ set (12) -
local
_ variables (11) - new (12)
- of (12)
-
proc
_ binding (12) -
rb
_ f _ binding (12) -
rb
_ obj _ is _ block (12) - receiver (11)
-
report
_ on _ exception (9) -
report
_ on _ exception= (9) - result (12)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) - run (12)
- self (12)
-
set
_ trace _ func (24) -
source
_ location (7) - top (24)
-
trace
_ func (24) - tracer (12)
- xmp (12)
- パターンマッチ (12)
検索結果
先頭5件
-
static VALUE rb
_ f _ binding(VALUE self) (32200.0) -
-
static VALUE rb
_ obj _ is _ block(VALUE block) (26116.0) -
proc が Proc または Binding のインスタンスであれば真。
...proc が Proc または Binding のインスタンスであれば真。... -
Kernel
. # binding -> Binding (21230.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 (21230.0) -
発生したイベントによって生成された Binding オブジェクトを返します。
...された Binding オブジェクトを返します。
C で記述されたメソッドは binding を生成しないため、
:c_call および :c_return イベントに対しては nil を返すことに注意してください。
//emlist[例][ruby]{
def foo(ret)
ret
end
trace = TracePoint.ne......w(:call) do |tp|
p tp.binding.local_variables # => [:ret]
end
trace.enable
foo 1
//}... -
Proc
# binding -> Binding (21224.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 (21224.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 _ defined?(symbol) -> bool (15130.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 (15130.0) -
引数 symbol で指定した名前のローカル変数に設定された値を返します。
...@param symbol ローカル変数名を Symbol オブジェクトで指定します。
@raise NameError 引数 symbol で指定したローカル変数が未定義の場合に発生します。
//emlist[例][ruby]{
def foo
a = 1
binding.local_variable_get(:a) # => 1
binding.local_variable_g......et(:b) # => NameError
end
//}
このメソッドは以下のコードの短縮形です。
//emlist[][ruby]{
binding.eval("#{symbol}")
//}
@see Binding#local_variable_set, Binding#local_variable_defined?... -
Binding
# local _ variable _ set(symbol , obj) (15130.0) -
引数 symbol で指定した名前のローカル変数に引数 obj を設定します。
...ます。
@param symbol ローカル変数名を Symbol オブジェクトで指定します。
@param obj 引数 symbol で指定したローカル変数に設定するオブジェクトを指定します。
//emlist[例][ruby]{
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(:b) # => 3
p a # => 2
p b......# => NameError
end
//}
このメソッドは以下のコード(ただし、obj が Ruby のコードで出力される場
合)と同様の動作をします。
//emlist[][ruby]{
binding.eval("#{symbol} = #{obj}")
//}
@see Binding#local_variable_get, Binding#local_variable_defined?... -
Binding
# local _ variables -> [Symbol] (15112.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")
//}...