compile(source, file = nil, path = nil, line = 1, options = nil) -> RubyVM::InstructionSequenceRuby 1.9.3 から[permalink][rdoc][edit]new(source, file = nil, path = nil, line = 1, options = nil) -> RubyVM::InstructionSequence-
引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
- [PARAM]
source: - Ruby のソースコードを文字列で指定します。
- [PARAM]
file: - ファイル名を文字列で指定します。
- [PARAM]
path: - 引数 file の絶対パスファイル名を文字列で指定します。
- [PARAM]
line: - 引数 source の 1 行目の行番号を指定します。
- [PARAM]
options: - コンパイル時のオプションを true、false、Hash オブジェクトのいずれかで指定します。詳細は RubyVM::InstructionSequence.compile_option= を参照してください。
p RubyVM::InstructionSequence.compile("a = 1 + 2") # => <RubyVM::InstructionSequence:<compiled>@<compiled>>[SEE_ALSO] RubyVM::InstructionSequence.compile_file
- [PARAM]