種類
- インスタンスメソッド (121)
- 特異メソッド (29)
- モジュール関数 (22)
- 定数 (11)
ライブラリ
- ビルトイン (66)
- benchmark (99)
-
rdoc
/ markup (11) -
ripper
/ lexer (7)
クラス
-
Benchmark
:: Job (22) -
Benchmark
:: Report (22) -
Benchmark
:: Tms (33) - Module (11)
-
RDoc
:: Markup (11) - Ripper (7)
-
RubyVM
:: InstructionSequence (22) -
Thread
:: Backtrace :: Location (22)
モジュール
- Benchmark (22)
オブジェクト
- main (11)
キーワード
-
LABEL
_ LIST _ RE (11) -
base
_ label (22) - benchmark (11)
- bm (11)
- format (11)
- item (22)
- lex (7)
- new (11)
- report (22)
- using (22)
検索結果
先頭5件
-
RubyVM
:: InstructionSequence # label -> String (27437.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
...elf が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、
モジュール名などで構成されます。
トップレベルでは "<main>" を返します。self を文字列から作成していた場合
は "<compiled>" を返します。
例1:i......
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "hello, world"
end
# irb
> i......seq = 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 # label -> String (27413.0) -
self が表すフレームのラベルを返します。通常、メソッド名、クラス名、モ ジュール名などで構成されます。
...self が表すフレームのラベルを返します。通常、メソッド名、クラス名、モ
ジュール名などで構成されます。
例: Thread::Backtrace::Location の例1を用いた例
//emlist[][ruby]{
loc = c(0..1).first
loc.label # => "a"
//}
@see Thread::Backtrace::Location......#base_label... -
Benchmark
:: Tms # label -> String (24401.0) -
ラベル。
ラベル。 -
RDoc
:: Markup :: LABEL _ LIST _ RE -> Regexp (18401.0) -
ラベル付きリストにマッチする正規表現です。ライブラリの内部で使用します。
ラベル付きリストにマッチする正規表現です。ライブラリの内部で使用します。 -
RubyVM
:: InstructionSequence # base _ label -> String (15437.0) -
self が表す命令シーケンスの基本ラベルを返します。
...lf が表す命令シーケンスの基本ラベルを返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compi......le_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::InstructionSeq......uence.of(method(:hello)).base_label
# => "hello"
@see RubyVM::InstructionSequence#label... -
Thread
:: Backtrace :: Location # base _ label -> String (15435.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
# => initialize
# new
# <main>
//}
@see Thread::Backtrace::Location#label... -
Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1) -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] (9506.0) -
Ruby プログラム str をトークンに分割し、そのリストを返します。 ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
...Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
@param src Ruby プログラムを文字列か IO オブジェクトで指定します。
@param filename src のファイル名を文字列で指定します。省略すると "-" になります。
@param lin......す。
//emlist[][ruby]{
require 'ripper'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :on_kw, "def", EXPR_FNAME],
# [[1, 3], :on_sp, " ", EXPR_FNAME],
# [[1, 4], :on_ident, "m", EXPR_ENDFN],
# [[1, 5], :on_lparen, "(", EXPR_BEG|EXPR_LABEL],
# [[1, 6], :on_ident, "a", EXPR_AR......1, 7], :on_rparen, ")", EXPR_ENDFN],
# [[1, 8], :on_sp, " ", EXPR_BEG],
# [[1, 9], :on_kw, "nil", EXPR_END],
# [[1, 12], :on_sp, " ", EXPR_END],
# on_kw, "end", EXPR_END
//}
Ripper.lex は分割したトークンを詳しい情報とともに返します。
返り値の配列の要......1 になります。
//emlist[][ruby]{
require 'ripper'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :on_kw, "def", FNAME],
# [[1, 3], :on_sp, " ", FNAME],
# [[1, 4], :on_ident, "m", ENDFN],
# [[1, 5], :on_lparen, "(", BEG|LABEL],
# [[1, 6], :on_ident, "a", ARG],
# [[1,......7], :on_rparen, ")", ENDFN],
# [[1, 8], :on_sp, " ", BEG],
# [[1, 9], :on_kw, "nil", END],
# [[1, 12], :on_sp, " ", END],
# on_kw, "end", END
//}
Ripper.lex は分割したトークンを詳しい情報とともに返します。
返り値の配列の要素は 4 要素の配列 (概... -
Ripper
. lex(src , filename = & # 39;-& # 39; , lineno = 1 , raise _ errors: false) -> [[Integer , Integer] , Symbol , String , Ripper :: Lexer :: State] (9506.0) -
Ruby プログラム str をトークンに分割し、そのリストを返します。 ただし Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
...Ripper.tokenize と違い、トークンの種類と位置情報も付属します。
@param src Ruby プログラムを文字列か IO オブジェクトで指定します。
@param filename src のファイル名を文字列で指定します。省略すると "-" になります。
@param lin......false になります。
@raise SyntaxError raise_errors が true で、src に文法エラーがある場合に発生します。
//emlist[][ruby]{
require 'ripper'
pp Ripper.lex("def m(a) nil end")
# => [[[1, 0], :on_kw, "def", FNAME],
# [[1, 3], :on_sp, " ", FNAME],
# [[1, 4], :on_id......, :on_lparen, "(", BEG|LABEL],
# [[1, 6], :on_ident, "a", ARG],
# [[1, 7], :on_rparen, ")", ENDFN],
# [[1, 8], :on_sp, " ", BEG],
# [[1, 9], :on_kw, "nil", END],
# [[1, 12], :on_sp, " ", END],
# on_kw, "end", END
Ripper.lex("def req(true) end", raise_errors: true)
# => Synta... -
Module
# using(module) -> self (9306.0) -
引数で指定したモジュールで定義された拡張を現在のクラス、モジュールで有 効にします。
...ルで有
効にします。
有効にした拡張の有効範囲については以下を参照してください。
* https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html#label-Scope
@param module 有効にするモジュールを指定します。
@see Module#refine, main.using... -
main
. using(module) -> self (9306.0) -
引数で指定したモジュールで定義された拡張を有効にします。
...s.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"
using Sloth
"ABC".downcase # => "ABC"......//}
@see Module#refine, Module#using... -
Benchmark
:: Job # item(label = "") { . . . } -> self (6408.0) -
与えられたラベルとブロックをジョブリストに登録します。
...与えられたラベルとブロックをジョブリストに登録します。
@param label ラベル...