18件ヒット
[1-18件を表示]
(0.008秒)
別のキーワード
ライブラリ
- ビルトイン (18)
キーワード
-
local
_ variables (11) -
source
_ location (7)
検索結果
-
Binding
# local _ variables -> [Symbol] (6114.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] (7.0) -
self の Ruby のソースファイル名と行番号を返します。
...self の Ruby のソースファイル名と行番号を返します。
d:spec/variables#pseudo の __FILE__ と __LINE__ も参照してください。
//emlist[例][ruby]{
p binding.source_location # => ["test.rb", 1]
//}...