426件ヒット
[201-300件を表示]
(0.071秒)
ライブラリ
- ビルトイン (378)
-
irb
/ context (12) -
irb
/ ext / history (24) - win32ole (12)
クラス
- BasicObject (48)
- Binding (70)
-
IRB
:: Context (36) - Module (96)
- Object (78)
- Proc (24)
-
RubyVM
:: InstructionSequence (24) - String (12)
- TracePoint (26)
-
WIN32OLE
_ TYPE (12)
キーワード
- binding (12)
-
class
_ eval (24) -
class
_ exec (12) -
default
_ event _ sources (12) -
define
_ method (24) - dump (12)
-
eval
_ history (12) -
eval
_ history= (12) -
eval
_ script (7) - evaluate (12)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ variables (12) -
instruction
_ sequence (7) -
local
_ variable _ defined? (12) -
local
_ variable _ get (12) -
local
_ variable _ set (12) -
local
_ variables (11) - method (12)
-
module
_ eval (24) -
module
_ exec (12) - receiver (11)
-
respond
_ to? (12) - self (12)
- send (24)
-
singleton
_ method (12) -
singleton
_ method _ undefined (12) -
source
_ location (12) - taint (6)
-
to
_ a (12)
検索結果
先頭5件
-
BasicObject
# instance _ exec(*args) {|*vars| . . . } -> object (7.0) -
与えられたブロックをレシーバのコンテキストで実行します。
...タに渡す値です。
//emlist[例][ruby]{
class KlassWithSecret
def initialize
@secret = 99
end
end
k = KlassWithSecret.new
# 以下で x には 5 が渡される
k.instance_exec(5) {|x| @secret + x } #=> 104
//}
@see Module#class_exec, Module#module_exec, BasicObject#instance_eval... -
BasicObject
# singleton _ method _ undefined(name) -> object (7.0) -
特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。
...leton method \"#{name}\" was undefined"
end
end
obj = Foo.new
def obj.foo
end
def obj.bar
end
class << obj
undef_method :foo
end
obj.instance_eval {undef bar}
#=> singleton method "foo" was undefined
# singleton method "bar" was undefined
//}
@see Module#method_undefined,BasicObject#single... -
Binding
# local _ variable _ defined?(symbol) -> bool (7.0) -
引数 symbol で指定した名前のローカル変数が定義されている場合に true を、 そうでない場合に false を返します。
...g.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 (7.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?... -
Binding
# local _ variable _ set(symbol , obj) (7.0) -
引数 symbol で指定した名前のローカル変数に引数 obj を設定します。
...# => NameError
end
//}
このメソッドは以下のコード(ただし、obj が Ruby のコードで出力される場
合)と同様の動作をします。
//emlist[][ruby]{
binding.eval("#{symbol} = #{obj}")
//}
@see Binding#local_variable_get, Binding#local_variable_defined?... -
Binding
# local _ variables -> [Symbol] (7.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
# receiver -> object (7.0) -
保持するコンテキスト内での self を返します。
...保持するコンテキスト内での self を返します。
このメソッドは以下のコードと同様の動作をします。
//emlist[][ruby]{
binding.eval("self")
//}... -
Module
# define _ method(name) { . . . } -> Symbol (7.0) -
インスタンスメソッド name を定義します。
...与えた場合、定義したメソッドの実行時にブロックが
レシーバクラスのインスタンスの上で BasicObject#instance_eval されます。
@param name メソッド名を String または Symbol を指定します。
@param method Proc、Method あるいは UnboundMethod... -
Module
# define _ method(name , method) -> Symbol (7.0) -
インスタンスメソッド name を定義します。
...与えた場合、定義したメソッドの実行時にブロックが
レシーバクラスのインスタンスの上で BasicObject#instance_eval されます。
@param name メソッド名を String または Symbol を指定します。
@param method Proc、Method あるいは UnboundMethod...