るりまサーチ

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

別のキーワード

  1. openssl integer
  2. asn1 integer
  3. _builtin integer
  4. integer rationalize
  5. integer each_prime

検索結果

RubyVM::InstructionSequence#first_lineno -> Integer (24515.0)

self が表す命令シーケンスの 1 行目の行番号を返します。

...self が表す命令シーケンスの 1 行目の行番号を返します。

例1:irb で実行した場合

RubyVM::InstructionSequence.compile('num = 1 + 2').first_lineno
# => 1

例2:

# /tmp/method.rb
require "foo-library"
def foo
p :foo
end

RubyVM::InstructionSequence.of(m...
...ethod(:foo)).first_lineno
# => 2...

RubyVM::AbstractSyntaxTree::Node#first_lineno -> Integer (24509.0)

ソースコード中で、self を表すテキストが最初に現れる行番号を返します。

...ソースコード中で、self を表すテキストが最初に現れる行番号を返します。

行番号は1-originです。

//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.first_lineno # => 1
//}...