るりまサーチ

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

別のキーワード

  1. irb/input-method new
  2. irb/input-method gets
  3. _builtin define_method
  4. irb/input-method encoding
  5. irb/input-method readable_atfer_eof?

検索結果

<< 1 2 3 ... > >>

Method#source_location -> [String, Integer] | nil (21024.0)

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

...@see Proc#source_location

//emlist[例][ruby]{
# ------- /tmp/foo.rb ---------
class Foo
def foo; end
end
# ----- end of /tmp/foo.rb ----

require '/tmp/foo'

m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m.source_location # => ["/tmp/foo.rb", 2]

method
(:puts).source_location # => nil
//}...

RubyVM::InstructionSequence.of(body) -> RubyVM::InstructionSequence (18177.0)

引数 body で指定した Proc、Method オブジェクトを元に RubyVM::InstructionSequence オブジェクトを作成して返します。

...Proc、Method オブジェクトを元に
RubyVM::InstructionSequence オブジェクトを作成して返します。

@param body Proc、Method オブジェクトを指定します。

例1:irb で実行した場合

# proc
> p = proc { num = 1 + 2 }
> RubyVM::InstructionSequence.of(p)
>...
...uence:block in irb_binding@(irb)>

# method
> def foo(bar); puts bar; end
> RubyVM::InstructionSequence.of(method(:foo))
> # => <RubyVM::InstructionSequence:foo@(irb)>

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/iseq_of.rb
def hello
puts "hello, worl...
...str = 'a' + 'b' }

# irb
> require '/tmp/iseq_of.rb'

# hello メソッド
> RubyVM::InstructionSequence.of(method(:hello))
> # => #<RubyVM::InstructionSequence:0x007fb73d7cb1d0>

# グローバル proc
> RubyVM::InstructionSequence.of($a_global_proc)
> # => #<RubyVM::InstructionSeq...

RubyVM::AbstractSyntaxTree.of(proc) -> RubyVM::AbstractSyntaxTree::Node (18120.0)

引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。

...M::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))

def hello
puts "hello, world"
end

pp RubyVM::AbstractSyntaxTree.of(method(:hello))
# => (SCOPE...

RubyVM::AbstractSyntaxTree.of(proc, keep_script_lines: false, error_tolerant: false, keep_tokens: false) -> RubyVM::AbstractSyntaxTree::Node (18120.0)

引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。

...M::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))

def hello
puts "hello, world"
end

pp RubyVM::AbstractSyntaxTree.of(method(:hello))
# => (SCOPE...

RubyVM::AbstractSyntaxTree.of(proc) -> RubyVM::AbstractSyntaxTree::Node (18119.0)

引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。

...M::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))

def hello
puts "hello, world"
end

pp RubyVM::AbstractSyntaxTree.of(method(:hello))
# => (SCOPE...

絞り込み条件を変える

WIN32OLE_METHOD#offset_vtbl -> Integer (9118.0)

このメソッドのVTBLのオフセットを取得します。

...出すために利用する関数ポインタのテーブルです。

@return メソッドのVTBL上のオフセットを返します。

tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Workbooks')
method
= WIN32OLE_METHOD.new(tobj, 'Add')
puts method.offset_vtbl # => 40...

IRB::InputMethod#readable_atfer_eof? -> false (9116.0)

入力が EOF(End Of File)に達した後も読み込みが行えるかどうかを返します。

...入力が EOF(End Of File)に達した後も読み込みが行えるかどうかを返します。...

IRB::ReadlineInputMethod#eof? -> bool (9116.0)

入力が EOF(End Of File)に達したかどうかを返します。

...入力が EOF(End Of File)に達したかどうかを返します。...

IRB::ReadlineInputMethod#readable_atfer_eof? -> false (9116.0)

入力が EOF(End Of File)に達した後も読み込みが行えるかどうかを返します。

...入力が EOF(End Of File)に達した後も読み込みが行えるかどうかを返します。...

IRB::StdioInputMethod#eof? -> bool (9116.0)

入力が EOF(End Of File)に達したかどうかを返します。

...入力が EOF(End Of File)に達したかどうかを返します。...

絞り込み条件を変える

IRB::StdioInputMethod#readable_atfer_eof? -> true (9116.0)

入力が EOF(End Of File)に達した後も読み込みが行えるかどうかを返します。

...入力が EOF(End Of File)に達した後も読み込みが行えるかどうかを返します。...

Profiler__ (6012.0)

プロファイラの実装です。 Profiler__.start_profile 実行から、Profiler__.stop_profile までの 区間の実行コードのプロファイルを取得します。

...ァイラの実装です。
Profiler__.start_profile 実行から、Profiler__.stop_profile までの
区間の実行コードのプロファイルを取得します。

以下の使用例を参照してください。

require 'profiler'

Profiler__.start_profile
require 'tk' # こ...
...のコードのプロファイルが測定される
Profiler__.print_profile(STDOUT)

# =>
% cumulative self self total
time seconds seconds calls ms/call ms/call name
51.64 1.10 1.10 3 366.67 776.67 Kernel.require
17.37...
...1 370.00 370.00 TclTkIp#initialize
8.92 1.66 0.19 514 0.37 0.37 Module#method_added
6.57 1.80 0.14 1 140.00 140.00 Profiler__.start_profile
4.23 1.89 0.09 15 6.00 10.67 Kernel.extend
3.29 1.96 0.07...
<< 1 2 3 ... > >>