るりまサーチ

最速Rubyリファレンスマニュアル検索!
183件ヒット [1-100件を表示] (0.042秒)
トップページ > クエリ:IO[x] > クエリ:ins[x] > 種類:特異メソッド[x]

別のキーワード

  1. io popen
  2. io pipe
  3. io each
  4. io readlines
  5. io each_line

検索結果

<< 1 2 > >>

RubyVM::InstructionSequence.compile_option=(options) (12201.0)

命令シーケンスのコンパイル時のデフォルトの最適化オプションを引数 options で指定します。

...命令シーケンスのコンパイル時のデフォルトの最適化オプションを引数
options で指定します。

@param options コンパイル時の最適化オプションを true、false、nil、
Hash のいずれかで指定します。true を指定した場合は...
...を指定します。
//emlist{
* :inline_const_cache
* :instructions_unification
* :operands_unification
* :peephole_optimization
* :specialized_instruction
* :stack_caching
* :tailcall_optimization
* :trace_instruction
//}
:debug_level をキーに指定した場合...
...compile、.compile_file メソッドの実行の際に option 引数を指定し
た場合はその実行のみ最適化オプションを変更する事もできます。

@see RubyVM::InstructionSequence.new,
RubyVM::InstructionSequence.compile,
RubyVM::InstructionSequence.compile_file...

RubyVM::InstructionSequence.compile_option -> Hash (12101.0)

命令シーケンスのコンパイル時のデフォルトの最適化オプションを Hash で返 します。

...pp RubyVM::InstructionSequence.compile_option

# => {:inline_const_cache=>true,
# :peephole_optimization=>true,
# :tailcall_optimization=>false,
# :specialized_instruction=>true,
# :operands_unification=>true,
# :instructions_unification=>false,
# :stack_caching=>false,
# :trace_instruction=>true,
#...
...:frozen_string_literal=>false,
# :debug_frozen_string_literal=>false,
# :coverage_enabled=>true,
# :debug_level=>0}
//}

@see RubyVM::InstructionSequence.compile_option=...

RubyVM::InstructionSequence.compile(source, file = nil, path = nil, line = 1, options = nil) -> RubyVM::InstructionSequence (6301.0)

引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。

...引数 source で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。

@param source Ruby のソースコードを文字列で指定します。

@param file ファイル名を文字列で指定しま...
...@param options コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。

RubyVM::InstructionSequence.compil...
...e("a = 1 + 2")
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>

@see RubyVM::InstructionSequence.compile_file...

RubyVM::InstructionSequence.compile_file(file, options = nil) -> RubyVM::InstructionSequence (6301.0)

引数 file で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。

...みの
RubyVM::InstructionSequence オブジェクトを作成して返します。

RubyVM::InstructionSequence.compile とは異なり、file、path などの
メタデータは自動的に取得します。

@param file ファイル名を文字列で指定します。

@param options コンパイ...
...RubyVM::InstructionSequence.compile_option= を参照
してください。

# /tmp/hello.rb
puts "Hello, world!"

# irb
RubyVM::InstructionSequence.compile_file("/tmp/hello.rb")
# => <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>

@see RubyVM::InstructionSequence.co...

RubyVM::InstructionSequence.new(source, file = nil, path = nil, line = 1, options = nil) -> RubyVM::InstructionSequence (6301.0)

引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。

...引数 source で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。

@param source Ruby のソースコードを文字列で指定します。

@param file ファイル名を文字列で指定しま...
...@param options コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。

RubyVM::InstructionSequence.compil...
...e("a = 1 + 2")
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>

@see RubyVM::InstructionSequence.compile_file...

絞り込み条件を変える

CSV.instance(data = $stdout, options = Hash.new) -> CSV (6207.0)

このメソッドは CSV.new のように CSV のインスタンスを返します。 しかし、返される値は Object#object_id と与えられたオプションを キーとしてキャッシュされます。

...価した
結果を返します。

@param data String か IO のインスタンスを指定します。

@param options CSV.new のオプションと同じオプションを指定できます。

//emlist[例][ruby]{
require "csv"

options = { headers: true }

text =<<-EOS
id,first name,last name,a...
...ge
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
EOS

csv = CSV.instance(text, options)
csv2 = CSV.instance(text, options)
csv.object_id == csv2.object_id # => true
print csv.read

# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adac...

CSV.instance(data = $stdout, options = Hash.new) {|csv| ... } -> object (6207.0)

このメソッドは CSV.new のように CSV のインスタンスを返します。 しかし、返される値は Object#object_id と与えられたオプションを キーとしてキャッシュされます。

...価した
結果を返します。

@param data String か IO のインスタンスを指定します。

@param options CSV.new のオプションと同じオプションを指定できます。

//emlist[例][ruby]{
require "csv"

options = { headers: true }

text =<<-EOS
id,first name,last name,a...
...ge
1,taro,tanaka,20
2,jiro,suzuki,18
3,ami,sato,19
4,yumi,adachi,21
EOS

csv = CSV.instance(text, options)
csv2 = CSV.instance(text, options)
csv.object_id == csv2.object_id # => true
print csv.read

# => id,first name,last name,age
# 1,taro,tanaka,20
# 2,jiro,suzuki,18
# 3,ami,sato,19
# 4,yumi,adac...

REXML::Instruction.new(target, content = nil) -> REXML::Instruction (6201.0)

新たな Instruction オブジェクトを生成します。

...新たな Instruction オブジェクトを生成します。

@param target ターゲット
@param content 内容...

RubyVM::InstructionSequence.load_from_binary(binary) -> RubyVM::InstructionSequence (6201.0)

RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。

...RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。

このローダーは検証機構をもっておらず、壊れたり改変されたバイナリを読み込むと深刻な問題を引き起...
...りません。自分が変換したバイナリデータを使うべきです。

//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary
RubyVM::InstructionSequence.load_from_binary(binary).eval # => 3
//}

@see RubyVM::InstructionSequence#to_binary...

RubyVM::InstructionSequence.of(body) -> RubyVM::InstructionSequence (6201.0)

引数 body で指定した Proc、Method オブジェクトを元に RubyVM::InstructionSequence オブジェクトを作成して返します。

...
RubyVM::InstructionSequence オブジェクトを作成して返します。

@param body Proc、Method オブジェクトを指定します。

例1:irb で実行した場合

# proc
> p = proc { num = 1 + 2 }
> RubyVM::InstructionSequence.of(p)
> # => <RubyVM::InstructionSequence:block...
...in irb_binding@(irb)>

# method
> def foo(bar); puts bar; end
> RubyVM::InstructionSequence.of(method(:foo))
> # => <RubyVM::InstructionSequence:foo@(irb)>

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

# /tmp/iseq_of.rb
def hello
puts "hello, world"
end...
...rb
> require '/tmp/iseq_of.rb'

# hello メソッド
> RubyVM::InstructionSequence.of(method(:hello))
> # => #<RubyVM::InstructionSequence:0x007fb73d7cb1d0>

# グローバル proc
> RubyVM::InstructionSequence.of($a_global_proc)
> # => #<RubyVM::InstructionSequence:0x007fb73d7caf78>...
...irb
> require '/tmp/iseq_of.rb'

# hello メソッド
> RubyVM::InstructionSequence.of(method(:hello))
> # => #<RubyVM::InstructionSequence:0x007fb73d7cb1d0>

# グローバル proc
> RubyVM::InstructionSequence.of($a_global_proc)
> # => #<RubyVM::InstructionSequence:0x007fb73d7caf78>...

絞り込み条件を変える

<< 1 2 > >>