るりまサーチ

最速Rubyリファレンスマニュアル検索!
127件ヒット [1-100件を表示] (0.026秒)

別のキーワード

  1. optparse on
  2. optionparser on
  3. tracer on
  4. socket udp_server_loop_on
  5. thread abort_on_exception

検索結果

<< 1 2 > >>

RubyVM::InstructionSequence#eval -> object (21108.0)

self の命令シーケンスを評価してその結果を返します。

...self の命令シーケンスを評価してその結果を返します。

RubyVM::InstructionSequence.compile("1 + 2").eval # => 3...

IRB::Context#eval_history=(val) (9114.0)

実行結果の履歴の最大保存件数を val に設定します。

...実行結果の履歴の最大保存件数を val に設定します。

.irbrc ファイル中で IRB.conf[:EVAL_HISTORY] を設定する事でも同様の事が
行えます。

@param val 実行結果の履歴の最大保存件数を Integer か nil で指定し
ます。0 を指定...
...た場合は無制限に履歴を保存します。現在の値よ
りも小さい値を指定した場合は履歴がその件数に縮小されます。
nil を指定した場合は履歴の追加がこれ以上行われなくなります。

@see IRB::Context#eval_history...

IRB::Context#eval_history -> Integer | nil (9108.0)

実行結果の履歴の最大保存件数を Integer か nil で返します。

...履歴の最大保存件数を Integer か nil で返します。

@return 履歴の最大保存件数を Integer か nil で返します。0 を返し
た場合は無制限に保存します。nil を返した場合は追加の保存は行いません。

@see IRB::Context#eval_history=...

IRB::Context#evaluate(line, line_no) -> object (9101.0)

ライブラリ内部で使用します。

ライブラリ内部で使用します。

TracePoint#instruction_sequence -> RubyVM::InstructionSequence (6213.0)

script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。

...ンパイルされた
RubyVM::InstructionSequenceインスタンスを返します。

//emlist[例][ruby]{
TracePoint.new(:script_compiled) do |tp|
p tp.instruction_sequence # => <RubyVM::InstructionSequence:block in <main>@(eval):1>
end.enable do
eval
("puts 'hello'")
end
//}

@raise RuntimeErr...

絞り込み条件を変える

Proc#source_location -> [String, Integer] | nil (6113.0)

ソースコードのファイル名と行番号を配列で返します。

...by]{
# /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_location # => nil
//}

@see Method#source_location...

BasicObject#singleton_method_undefined(name) -> object (6107.0)

特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。

...ss 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
# singleton method "bar" was un...
...defined
//}

@see Module#method_undefined,BasicObject#singleton_method_added,BasicObject#singleton_method_removed , d:spec/def#undef...

Object#respond_to?(name, include_all = false) -> bool (6107.0)

オブジェクトがメソッド name を持つとき真を返します。

...メソッドで NotImplementedError が発生する場合は true を返します。

メソッドが定義されていない場合は、Object#respond_to_missing? を呼
び出してその結果を返します。

@param name Symbol または文字列で指定するメソッド名です。

@param...
...ass F
def hello
"Bonjour"
end
end

class D
private
def hello
"Guten Tag"
end
end
list = [F.new,D.new]

list.each{|it| puts it.hello if it.respond_to?(:hello)}
#=> Bonjour

list.each{|it| it.instance_eval("puts hello if it.respond_to?(:hello, true)")}
#=> Bonjour
# Guten Tag

modu...
...espond_to?(:template_method) # => true
# NotImplementedError が発生しているが、Rubyによる実装部のため true を返す
puts NotImplTemplateMethod.new.respond_to?(:template_method) # => true
# GNU/Linux で実行。C言語による実装部のため false を返す
puts File.respond_t...

Object#singleton_method(name) -> Method (6107.0)

オブジェクトの特異メソッド name をオブジェクト化した Method オブ ジェクトを返します。

...o.new(99)
def k.hi
"Hi, @iv = #{@iv}"
end
m = k.singleton_method(:hi) # => #<Method: #<Demo:0xf8b0c3c4 @iv=99>.hi>
m.call #=> "Hi, @iv = 99"
m = k.singleton_method(:hello) # => NameError
//}

@see Module#instance_method, Method, BasicObject#__send__, Object#send, Kernel.#eval, Object#method...
<< 1 2 > >>