324件ヒット
[101-200件を表示]
(0.114秒)
ライブラリ
- ビルトイン (276)
-
irb
/ context (12) -
irb
/ ext / history (24) - win32ole (12)
クラス
- BasicObject (36)
- Binding (59)
-
IRB
:: Context (36) - Module (96)
- Object (42)
- Proc (12)
-
RubyVM
:: InstructionSequence (12) - TracePoint (19)
-
WIN32OLE
_ TYPE (12)
キーワード
-
class
_ eval (24) -
class
_ exec (12) -
default
_ event _ sources (12) -
define
_ method (24) -
eval
_ history (12) -
eval
_ history= (12) -
eval
_ script (7) - evaluate (12)
-
instance
_ eval (24) -
instance
_ variables (12) -
local
_ variable _ defined? (12) -
local
_ variable _ get (12) -
local
_ variable _ set (12) -
local
_ variables (11) -
module
_ eval (24) -
module
_ exec (12) -
respond
_ to? (12) - self (12)
-
singleton
_ method (12) -
singleton
_ method _ undefined (12) -
source
_ location (12) - taint (6)
検索結果
先頭5件
-
IRB
:: Context # eval _ history=(val) (12214.0) -
実行結果の履歴の最大保存件数を val に設定します。
...実行結果の履歴の最大保存件数を val に設定します。
.irbrc ファイル中で IRB.conf[:EVAL_HISTORY] を設定する事でも同様の事が
行えます。
@param val 実行結果の履歴の最大保存件数を Integer か nil で指定し
ます。0 を指定し......た場合は無制限に履歴を保存します。現在の値よ
りも小さい値を指定した場合は履歴がその件数に縮小されます。
nil を指定した場合は履歴の追加がこれ以上行われなくなります。
@see IRB::Context#eval_history... -
TracePoint
# eval _ script -> String | nil (12214.0) -
script_compiledイベント発生時にコンパイルされたソースコードを返します。 ファイルから読み込んだ場合は、nilを返します。
..._compiledイベント発生時にコンパイルされたソースコードを返します。
ファイルから読み込んだ場合は、nilを返します。
//emlist[例][ruby]{
TracePoint.new(:script_compiled) do |tp|
p tp.eval_script # => "puts 'hello'"
end.enable do
eval("puts 'hello'")......end
//}
@raise RuntimeError :script_compiled イベントのための
イベントフックの外側で実行した場合に発生します。... -
IRB
:: Context # eval _ history -> Integer | nil (12208.0) -
実行結果の履歴の最大保存件数を Integer か nil で返します。
...履歴の最大保存件数を Integer か nil で返します。
@return 履歴の最大保存件数を Integer か nil で返します。0 を返し
た場合は無制限に保存します。nil を返した場合は追加の保存は行いません。
@see IRB::Context#eval_history=... -
IRB
:: Context # evaluate(line , line _ no) -> object (12201.0) -
ライブラリ内部で使用します。
ライブラリ内部で使用します。 -
Module
# class _ exec(*args) {|*vars| . . . } -> object (6113.0) -
与えられたブロックを指定された args を引数としてモジュールのコンテキストで評価します。
...ュールのコンテキストで評価します。
モジュールのコンテキストで評価するとは、実行中そのモジュールが self になるということです。
つまり、そのモジュールの定義式の中にあるかのように実行されます。
ローカル変......定します。
//emlist[例][ruby]{
class Thing
end
c = 1
Thing.class_exec{
def hello()
"Hello there!"
end
define_method(:foo) do # ローカル変数がブロックの外側を参照している
c
end
}
t = Thing.new
p t.hello() #=> "Hello there!"
p t.foo()......#=> 1
//}
@see Module#module_eval, Module#class_eval... -
Module
# module _ exec(*args) {|*vars| . . . } -> object (6113.0) -
与えられたブロックを指定された args を引数としてモジュールのコンテキストで評価します。
...ュールのコンテキストで評価します。
モジュールのコンテキストで評価するとは、実行中そのモジュールが self になるということです。
つまり、そのモジュールの定義式の中にあるかのように実行されます。
ローカル変......定します。
//emlist[例][ruby]{
class Thing
end
c = 1
Thing.class_exec{
def hello()
"Hello there!"
end
define_method(:foo) do # ローカル変数がブロックの外側を参照している
c
end
}
t = Thing.new
p t.hello() #=> "Hello there!"
p t.foo()......#=> 1
//}
@see Module#module_eval, Module#class_eval... -
Proc
# source _ location -> [String , Integer] | nil (6113.0) -
ソースコードのファイル名と行番号を配列で返します。
...は nil を返します。
//emlist[例][ruby]{
# /path/to/target.rb を実行
proc {}.source_location # => ["/path/to/target.rb", 1]
proc {}.source_location # => ["/path/to/target.rb", 2]
(eval "proc {}").source_location # => ["(eval)", 1]
method(:p).to_proc.source_locatio......n # => nil
//}
@see Method#source_location... -
BasicObject
# singleton _ method _ undefined(name) -> object (6107.0) -
特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。
...が Module#undef_method または
undef により未定義にされた時にインタプリタから呼び出されます。
通常のメソッドの未定義に対するフックには
Module#method_undefined を使います。
@param name 未定義にされたメソッド名が Symbol で渡さ......emlist[例][ruby]{
class Foo
def singleton_method_undefined(name)
puts "singleton 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
# singlet......on method "bar" was undefined
//}
@see Module#method_undefined,BasicObject#singleton_method_added,BasicObject#singleton_method_removed , d:spec/def#undef... -
Binding
# local _ variable _ defined?(symbol) -> bool (6107.0) -
引数 symbol で指定した名前のローカル変数が定義されている場合に true を、 そうでない場合に false を返します。
...symbol で指定した名前のローカル変数が定義されている場合に true を、
そうでない場合に false を返します。
@param symbol ローカル変数名を Symbol オブジェクトで指定します。
//emlist[例][ruby]{
def foo
a = 1
binding.local_variable_defi......ned?(: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 (6107.0) -
引数 symbol で指定した名前のローカル変数に設定された値を返します。
...symbol で指定した名前のローカル変数に設定された値を返します。
@param symbol ローカル変数名を Symbol オブジェクトで指定します。
@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?...