るりまサーチ

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

別のキーワード

  1. _builtin end
  2. ripper end_seen?
  3. _builtin exclude_end?
  4. _builtin end_with?
  5. zlib end

ライブラリ

キーワード

検索結果

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

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

...iled>@<compiled>>
iseq.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.label # => "<main>"

例3:...
...# /tmp/method2.rb
def hello
puts "hello, world"
end


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

@see RubyVM::InstructionSequence#base_label...

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

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

...ce::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


# => initia...
...lize
# new
# <main>
//}

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

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

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

...ompiled>>
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...

UncaughtThrowError#tag -> object (25.0)

Kernel.#throw に指定した tag を返します。

...Kernel.#throw に指定した tag を返します。

//emlist[例:][ruby]{
def do_complicated_things
throw :uncaught_label
end


begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.tag # => ":uncaught_label"
end

//}...

UncaughtThrowError#to_s -> String (25.0)

self を tag を含む文字列表現にして返します。

...self を tag を含む文字列表現にして返します。

//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label
end


begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.to_s # => "uncaught throw :uncaught_label"
end

//}...

絞り込み条件を変える

UncaughtThrowError#value -> object (19.0)

Kernel.#throw に指定した value を返します。

...Kernel.#throw に指定した value を返します。

//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label, "uncaught_value"
end


begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.value # => "uncaught_value"
end

//}...