るりまサーチ

最速Rubyリファレンスマニュアル検索!
24件ヒット [1-24件を表示] (0.059秒)
トップページ > クエリ:main[x] > クエリ:compile_file[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. mkmf try_compile
  2. _builtin compile
  3. ripper compile_error
  4. kernel try_compile
  5. _builtin compile_file

ライブラリ

キーワード

検索結果

RubyVM::InstructionSequence#label -> String (25.0)

self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。

...ラベルを返します。通常、メソッド名、クラス名、
モジュール名などで構成されます。

トップレベルでは "<main>" を返します。self を文字列から作成していた場合
は "<compiled>" を返します。

例1:irb で実行した場合

iseq = Ru...
..."<compiled>"

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

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.label # => "<main>"

例3:

# /tmp/method2.rb
def hello
pu...

RubyVM::InstructionSequence#base_label -> String (19.0)

self が表す命令シーケンスの基本ラベルを返します。

...<compiled>"

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

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label # => "<main>"

例3:

# /tmp/method2.rb
def hello...