11件ヒット
[1-11件を表示]
(0.227秒)
検索結果
先頭5件
-
RubyVM
:: InstructionSequence # label -> String (78382.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、
モジュール名などで構成されます。
トップレベルでは "<main>" を返します。self を文字列から作成していた場合
は "<compiled>" を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled>"
例2: R... -
Thread
:: Backtrace :: Location # label -> String (78346.0) -
self が表すフレームのラベルを返します。通常、メソッド名、クラス名、モ ジュール名などで構成されます。
self が表すフレームのラベルを返します。通常、メソッド名、クラス名、モ
ジュール名などで構成されます。
例: Thread::Backtrace::Location の例1を用いた例
//emlist[][ruby]{
loc = c(0..1).first
loc.label # => "a"
//}
@see Thread::Backtrace::Location#base_label -
Thread
:: Backtrace :: Location # base _ label -> String (42394.0) -
self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。
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
# => init... -
RubyVM
:: InstructionSequence # base _ label -> String (42382.0) -
self が表す命令シーケンスの基本ラベルを返します。
self が表す命令シーケンスの基本ラベルを返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "h... -
UncaughtThrowError
# tag -> object (24043.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 (24043.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
//} -
Module
# using(module) -> self (24025.0) -
引数で指定したモジュールで定義された拡張を現在のクラス、モジュールで有 効にします。
引数で指定したモジュールで定義された拡張を現在のクラス、モジュールで有
効にします。
有効にした拡張の有効範囲については以下を参照してください。
* https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html#label-Scope
@param module 有効にするモジュールを指定します。
@see Module#refine, main.using -
RubyVM
:: InstructionSequence # inspect -> String (24025.0) -
self の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。
self の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.inspect # => "<RubyVM::InstructionSequence:<compiled>@<compiled>>"
//}
@see RubyVM::InstructionSequence#label,
RubyVM::InstructionSequence#path -
RubyVM
:: InstructionSequence # to _ a -> Array (24025.0) -
self の情報を 14 要素の配列にして返します。
self の情報を 14 要素の配列にして返します。
命令シーケンスを以下の情報で表します。
: magic
データフォーマットを示す文字列。常に
"YARVInstructionSequence/SimpleDataFormat"。
: major_version
命令シーケンスのメジャーバージョン。
: minor_version
命令シーケンスのマイナーバージョン。
: format_type
データフォーマットを示す数値。常に 1。
: misc
以下の要素から構成される Hash オブジェクト。
:arg_size: メソッド、ブ... -
UncaughtThrowError
# value -> object (24025.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
//} -
main
. using(module) -> self (24025.0) -
引数で指定したモジュールで定義された拡張を有効にします。
引数で指定したモジュールで定義された拡張を有効にします。
有効にした拡張の有効範囲については以下を参照してください。
* https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html#label-Scope
@param module 有効にするモジュールを指定します。
//emlist[例][ruby]{
module Sloth
refine String do
def downcase
self
end
end
end
"ABC".downcase # => "abc"...