るりまサーチ

最速Rubyリファレンスマニュアル検索!
461件ヒット [1-100件を表示] (0.059秒)
トップページ > クエリ:p[x] > クエリ:binding[x]

別のキーワード

  1. openssl p
  2. openssl p=
  3. fileutils mkdir_p
  4. _builtin p
  5. kernel p

検索結果

<< 1 2 3 ... > >>

static VALUE proc_binding(VALUE proc) (32300.0)

TracePoint#binding -> Binding | nil (21236.0)

発生したイベントによって生成された Binding オブジェクトを返します。

...れた Binding オブジェクトを返します。

C で記述されたメソッドは binding を生成しないため、
:c_call および :c_return イベントに対しては nil を返すことに注意してください。

//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 (21230.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
//}...

Proc#binding -> Binding (21224.0)

Proc オブジェクトが保持するコンテキストを Binding オブジェクトで返します。

...
P
roc オブジェクトが保持するコンテキストを
Binding
オブジェクトで返します。

//emlist[例][ruby]{
def fred(param)
p
roc {}
end

sample_proc = fred(99)
eval("param", sample_proc.binding) # => 99
//}...

Kernel.#binding -> Binding (18236.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...

絞り込み条件を変える

Object::TOPLEVEL_BINDING -> Binding (12324.0)

トップレベルでの Binding オブジェクト。

...トップレベルでの Binding オブジェクト。

詳細は Binding を参照してください。...

Binding#eval(expr, fname = __FILE__, lineno = 1) -> object (9130.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
e...
...val("str + ' Fred'") #=> "hello Fred"
p
get_binding("bye").eval("str + ' Fred'") #=> "bye Fred"
//}

@see Kernel.#eval...

Binding#local_variable_set(symbol, obj) (9054.0)

引数 symbol で指定した名前のローカル変数に引数 obj を設定します。

...を設定します。

@param symbol ローカル変数名を Symbol オブジェクトで指定します。

@param obj 引数 symbol で指定したローカル変数に設定するオブジェクトを指定します。

//emlist[例][ruby]{
def foo
a = 1
bind = binding
bind.local_variable_...
...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#source_location -> [String, Integer] (9012.0)

self の Ruby のソースファイル名と行番号を返します。

...self の Ruby のソースファイル名と行番号を返します。

d:spec/variables#pseudo の __FILE__ と __LINE__ も参照してください。

//emlist[例][ruby]{
p
binding.source_location # => ["test.rb", 1]
//}...

IRB::Frame#top(n = 0) -> Binding (6201.0)

上から n 番目のコンテキストを取り出します。

...上から n 番目のコンテキストを取り出します。

@param n 取り出すコンテキストを Integer で指定します。n は 0 が最
上位になります。...

絞り込み条件を変える

<< 1 2 3 ... > >>