るりまサーチ (Ruby 2.5.0)

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

別のキーワード

  1. irb/input-method gets
  2. irb/input-method new
  3. _builtin define_method
  4. irb/input-method encoding
  5. irb/input-method readable_atfer_eof?

クラス

モジュール

キーワード

検索結果

RubyVM::InstructionSequence#path -> String (54418.0)

self が表す命令シーケンスの相対パスを返します。

self が表す命令シーケンスの相対パスを返します。

self の作成時に指定した文字列を返します。self を文字列から作成していた
場合は "<compiled>" を返します。

例1:irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.path
# => "<compiled>"

例2: RubyVM::InstructionSequence.compi...

RubyVM::InstructionSequence#absolute_path -> String | nil (18418.0)

self が表す命令シーケンスの絶対パスを返します。

self が表す命令シーケンスの絶対パスを返します。

self を文字列から作成していた場合は nil を返します。

例1:irb で実行した場合

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil

例2: RubyVM::InstructionSequence.compile_file を使用した場合

# /tmp/method....

Proc#source_location -> [String, Integer] | nil (97.0)

ソースコードのファイル名と行番号を配列で返します。

ソースコードのファイル名と行番号を配列で返します。

その手続オブジェクトが ruby で定義されていない(つまりネイティブ
である)場合は nil を返します。


//emlist[例][ruby]{
# /path/to/target.rb を実行
proc {}.source_location # => ["/path/to/target.rb", 1]
proc {}.source_location # => ["/path/to/target.rb", 2]
(eval "proc {}").source_location # => ...

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

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

...ンドの配列の配列。


//emlist[例][ruby]{
require 'pp'

iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
pp iseq.to_a
# ※ Ruby 2.5.0 での実行結果
# => ["YARVInstructionSequence/SimpleDataFormat",
# 2,
# 0,
# 1,
# {:arg_size=>0, :local_size=>2, :stack_max=>2},
# "<compiled>"...

Kernel.#require_relative(relative_feature) -> bool (43.0)

現在のファイルからの相対パスで require します。

現在のファイルからの相対パスで require します。

require File.expand_path(relative_feature, File.dirname(__FILE__))
とほぼ同じです。

Kernel.#eval などで文字列を評価した場合に、そこから
require_relative を呼出すと必ず失敗します。

@param relative_feature ファイル名の文字列です。
@raise LoadError ロードに失敗した場合に発生します。
@see Kernel.#require

=== require と load のスコープ

ローカル変数...

絞り込み条件を変える