るりまサーチ

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

別のキーワード

  1. _builtin main
  2. main define_method
  3. main public
  4. main private
  5. main using

ライブラリ

オブジェクト

キーワード

検索結果

main.using(module) -> self (21006.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...

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

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

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

例1:irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compi...
...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 (6135.0)

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

...race::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...
...ialize
# new
# <main>
//}

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

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

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

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

rdoc (48.0)

RDoc は Ruby のドキュメント生成を行うためのライブラリです。rdoc という ドキュメント生成のためのコマンドも含んでいます。

...できます。
例えば、Rdoc そのもののドキュメントを生成する場合は、以下のようにタイプ
します。

$ rdoc --main rdoc/rdoc.rb

RDoc が生成するドキュメントのコメント部で使える様々なマークアップの方法
は以下の markup の項に...
...オプションを付けると、インラインで表示されます。

: --line-numbers

ソースコードに行番号を付けます。

: --main name

最初に表示されるページに置かれるもの(クラス、ファイルなど)を指定しま
す。もし、特定のファイ...
...スト
* 数字+ピリオドで番号付きリスト
* アルファベット+ピリオドで
アルファベットリスト

====[a:labeled_list] ラベル付きリスト

ラベル付きリスト(description list とも呼ばれる)は通常大括弧でラベルを囲
います。...

絞り込み条件を変える

NEWS for Ruby 2.0.0 (24.0)

NEWS for Ruby 2.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...追加: RubyVM::InstructionSequence#path,
RubyVM::InstructionSequence#absolute_path,
RubyVM::InstructionSequence#label,
RubyVM::InstructionSequence#base_label,
RubyVM::InstructionSequence#first_lineno to retrieve information from where
the instruction sequence was defin...
...of set_trace_func.
Easy to use and efficient implementation.

* toplevel
* added method:
* added main.define_method which defines a global function.
* added main.using, which imports refinements into the current file or
eval string. [experimental]

=== 組み込み...

RubyVM::InstructionSequence#to_a -> Array (18.0)

self の情報を 14 要素の配列にして返します。

...ックの深さ。(SystemStackError を検出するために使用)

: #label

メソッド名、クラス名、モジュール名などで構成される命令シーケンスのラ
ベル。トップレベルでは "<main>"。文字列から作成していた場合は
"<compiled>"。

: #path...
...ケンスの 1 行目の行番号。

: type

命令シーケンスの種別。
:top、:method、:block、:class、:rescue、:ensure、:eval、:main
:defined_guard のいずれか。

: locals

全ての引数名、ローカル変数名からなる Symbol の配列。

: args

引数の...

Module#using(module) -> self (12.0)

引数で指定したモジュールで定義された拡張を現在のクラス、モジュールで有 効にします。

...ルで有
効にします。

有効にした拡張の有効範囲については以下を参照してください。

* https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html#label-Scope

@param module 有効にするモジュールを指定します。

@see Module#refine, main.using...