るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.302秒)
トップページ > クエリ:_builtin[x] > クエリ:puts[x] > クエリ:base_label[x]

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

検索結果

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

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

...@<compiled>>
iseq.base_label
# => "<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
puts
"hello, world"
end

RubyVM::InstructionSequence.of(method(:hello)).base_label
# => "hello"

@see RubyVM::InstructionSequence#label...

Thread::Backtrace::Location#base_label -> String (26113.0)

self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。

...されます。

//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end

Foo.new(0..2).locations.map do |call|
puts
call.base_label
end

# => initialize
# new
# <main>
//}

@see Thread::Backtrace::Location#label...

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

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

...ile を使用した場合

# /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
puts
"hello, world"
end

RubyVM::InstructionSequence.of(...
...method(:hello)).label
# => "hello"

@see RubyVM::InstructionSequence#base_label...