るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. matrix i

検索結果

<< 1 2 3 ... > >>

TracePoint#binding -> Binding | nil (33730.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 (33724.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
//}...

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

Proc#binding -> Binding (30724.0)

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

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

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

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

irb (26354.0)

irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。

...irb は Interactive Ruby の略です。
i
rb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。

=== irb の使い方

Ruby さえ知っていれば irb を使うのは簡単です。
i
rb コマンドを実行すると、以下のようなプロン...
...す。
readline ライブラリがインストールされている時には
自動的にコマンドライン編集や履歴の機能が使えるようになります。

=== irb のコマンドラインオプション

i
rb [options] file_name opts
options:
-
f ~/.irbrc を読...
...る。
-
-back-trace-limit n
バックトレース表示をバックトレースの頭から n、
うしろから n だけ行なう。デフォルト値は 16。
-
-context-mode n 新しいワークスペースを作成した時に関連する Binding...

絞り込み条件を変える

Binding#local_variable_defined?(symbol) -> bool (21236.0)

引数 symbol で指定した名前のローカル変数が定義されている場合に true を、 そうでない場合に false を返します。

...//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#loc...
...al_variable_get, Binding#local_variable_set...

Object::TOPLEVEL_BINDING -> Binding (18724.0)

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

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

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

Binding#local_variable_get(symbol) -> object (18230.0)

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

...mbol オブジェクトで指定します。

@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] (18212.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#irb -> object (18206.0)

REPLのセッションを開始します。

...REPLのセッションを開始します。

2.5.0 からは require 'irb' せずに直接 binding.irb を呼び出しても使えるようになりました。

@see irb...

絞り込み条件を変える

Binding#receiver -> object (18206.0)

保持するコンテキスト内での self を返します。

...保持するコンテキスト内での self を返します。

このメソッドは以下のコードと同様の動作をします。

//emlist[][ruby]{
binding
.eval("self")
//}...
<< 1 2 3 ... > >>