るりまサーチ

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

別のキーワード

  1. _builtin >
  2. bigdecimal >
  3. integer >
  4. complex >
  5. module >

検索結果

<< 1 2 3 ... > >>

TracePoint#instruction_sequence -> RubyVM::InstructionSequence (6316.0)

script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。

...生時にコンパイルされた
RubyVM::InstructionSequenceインスタンスを返します。

//emlist[例][ruby]{
TracePoint.new(:script_compiled) do |tp|
p tp.instruction_sequence # => <RubyVM::InstructionSequence:block in <main>@(eval):1>
end.enable do
eval("puts 'hello'")
end
//}

@rais...

Encoding::InvalidByteSequenceError#incomplete_input? -> bool (3115.0)

エラー発生時に入力文字列が不足している場合に真を返します。

...ing::InvalidByteSequenceError
p $!
#=> #<Encoding::InvalidByteSequenceError: "\xA1" followed by "z" on EUC-JP>
p $!.incomplete_input? #=> false
end

begin
ec.convert("abc\xA1")
ec.finish
rescue Encoding::InvalidByteSequenceError
p $! #=> #<Encoding::InvalidByteSequenceError: incomplet...
...e "\xA1" on EUC-JP>
p $!.incomplete_input? #=> true
end
//}...

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

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

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

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

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
>
iseq = RubyVM::...
...InstructionSequence.compile_file('/tmp/method.rb')
>
iseq.absolute_path # => "/tmp/method.rb"

@see RubyVM::InstructionSequence#path...

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

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

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

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

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
>
iseq = RubyV...
...M::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...

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

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

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

例1:irb で実行した場合

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

絞り込み条件を変える

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

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

...ていた
場合は "<compiled>" を返します。

例1:irb で実行した場合

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

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

# /tmp/method.rb
def hello
puts "hello, world"
end

# irb
>
iseq = RubyVM::InstructionSequence.compile_file('method.rb')
>
iseq.path # => "method.rb"

@see RubyVM::InstructionSequence#absolute_path...

Encoding::InvalidByteSequenceError#error_bytes -> String (3109.0)

エラー発生時に捨てられたバイト列を返します。

...\xFFdef")
rescue Encoding::InvalidByteSequenceError
p $!
#=> #<Encoding::InvalidByteSequenceError: "\xA1" followed by "\xFF" on EUC-JP>
puts $!.error_bytes.dump #=> "\xA1"
puts $!.readagain_bytes.dump #=> "\xFF"
end
//}

@see Encoding::InvalidByteSequenceError#readagain_bytes...

RubyVM::InstructionSequence#disasm -> String (3109.0)

self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。

...InstructionSequence.compile('1 + 2').disasm

出力:

== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1 ( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 le...
...ave

@see RubyVM::InstructionSequence.disasm...

RubyVM::InstructionSequence#disassemble -> String (3109.0)

self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。

...InstructionSequence.compile('1 + 2').disasm

出力:

== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1 ( 1)
0002 putobject 1
0004 putobject 2
0006 opt_plus <ic:1>
0008 le...
...ave

@see RubyVM::InstructionSequence.disasm...

Encoding::InvalidByteSequenceError#destination_encoding -> Encoding (3103.0)

エラーを発生させた変換の変換先のエンコーディングを Encoding オブジェクトで返します。

...エラーを発生させた変換の変換先のエンコーディングを Encoding
オブジェクトで返します。

@see Encoding::InvalidByteSequenceError#source_encoding,
Encoding::UndefinedConversionError#destination_encoding...

絞り込み条件を変える

<< 1 2 3 ... > >>