別のキーワード
ライブラリ
- ビルトイン (11)
-
rexml
/ document (8) -
rexml
/ parsers / pullparser (1) -
rexml
/ sax2listener (1) -
rexml
/ streamlistener (1)
クラス
モジュール
キーワード
- == (1)
-
absolute
_ path (1) -
base
_ label (1) - clone (1)
- content (1)
- content= (1)
- disasm (1)
- disassemble (1)
- eval (1)
-
first
_ lineno (1) - inspect (1)
- instruction (1)
- instruction? (1)
- instructions (1)
- label (1)
-
node
_ type (1) - path (1)
-
processing
_ instruction (1) - target (1)
- target= (1)
-
to
_ a (1) -
to
_ binary (1)
検索結果
先頭5件
-
REXML
:: StreamListener # instruction(name , instruction) -> () (37246.0) -
XML処理命令(PI)をパースしたときに呼び出されるコールバックメソッドです。
XML処理命令(PI)をパースしたときに呼び出されるコールバックメソッドです。
@param name ターゲット名が文字列で渡されます
@param instruction 処理命令の内容が文字列で渡されます
=== 例
<?xml-stylesheet type="text/css" href="style.css"?>
というPIに対し
name: "xml-stylesheet"
instruction: " type=\"text/css\" href=\"style.css\""
という引数が渡されます。 -
REXML
:: Element # instructions -> [REXML :: Instraction] (36952.0) -
すべての instruction 子ノードの配列を返します。
すべての instruction 子ノードの配列を返します。
返される配列は freeze されます。 -
REXML
:: Parsers :: PullEvent # instruction? -> bool (36607.0) -
XML処理命令なら真を返します。
XML処理命令なら真を返します。 -
REXML
:: SAX2Listener # processing _ instruction(target , data) -> () (36607.0) -
XML 処理命令(PI)に対し呼び出されるコールバックメソッドです。
XML 処理命令(PI)に対し呼び出されるコールバックメソッドです。
@param target ターゲット名が文字列で渡されます
@param data 処理命令の内容が文字列で渡されます -
REXML
:: Instruction # clone -> REXML :: Instruction (18607.0) -
self を複製します。
self を複製します。 -
REXML
:: Instruction # node _ type -> Symbol (18052.0) -
Symbol :processing_instruction を返します。
Symbol :processing_instruction を返します。 -
REXML
:: Instruction # ==(other) -> bool (18040.0) -
other と self が同じ 処理命令である場合に真を返します。
other と self が同じ 処理命令である場合に真を返します。
同じとは、 REXML::Instruction#target と REXML::Instruction#content
が一致することを意味します。
@param other 比較対象 -
REXML
:: Instruction # content -> String | nil (18004.0) -
XML 処理命令の内容を返します。
XML 処理命令の内容を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<?foobar?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-stylesheet"
doc[2].content... -
REXML
:: Instruction # content=(value) (18004.0) -
XML 処理命令の内容を変更します。
XML 処理命令の内容を変更します。
@param value 新たなデータ(文字列) -
REXML
:: Instruction # target -> String (18004.0) -
XML 処理命令のターゲットを返します。
XML 処理命令のターゲットを返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-stylesheet"
doc[2].content # => "t... -
REXML
:: Instruction # target=(value) (18004.0) -
XML 処理命令のターゲットを value に変更します。
XML 処理命令のターゲットを value に変更します。
@param value 新たなターゲット(文字列) -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (18004.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.... -
RubyVM
:: InstructionSequence # base _ label -> String (18004.0) -
self が表す命令シーケンスの基本ラベルを返します。
self が表す命令シーケンスの基本ラベルを返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
puts "h... -
RubyVM
:: InstructionSequence # disasm -> String (18004.0) -
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
puts RubyVM::InstructionSequence.compile('1 + 2').disasm
出力:
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1 ( 1)
0002 putobject 1
0004 putobje... -
RubyVM
:: InstructionSequence # disassemble -> String (18004.0) -
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
puts RubyVM::InstructionSequence.compile('1 + 2').disasm
出力:
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1 ( 1)
0002 putobject 1
0004 putobje... -
RubyVM
:: InstructionSequence # eval -> object (18004.0) -
self の命令シーケンスを評価してその結果を返します。
self の命令シーケンスを評価してその結果を返します。
RubyVM::InstructionSequence.compile("1 + 2").eval # => 3 -
RubyVM
:: InstructionSequence # first _ lineno -> Integer (18004.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(method(:foo)).first_lineno
# => 2 -
RubyVM
:: InstructionSequence # inspect -> String (18004.0) -
self の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。
self の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.inspect # => "<RubyVM::InstructionSequence:<compiled>@<compiled>>"
//}
@see RubyVM::InstructionSequence#label,
RubyVM::InstructionSequence#path -
RubyVM
:: InstructionSequence # label -> String (18004.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、
モジュール名などで構成されます。
トップレベルでは "<main>" を返します。self を文字列から作成していた場合
は "<compiled>" を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled>"
例2: R... -
RubyVM
:: InstructionSequence # path -> String (18004.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 # to _ a -> Array (18004.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>"... -
RubyVM
:: InstructionSequence # to _ binary(extra _ data = nil) -> String (18004.0) -
バイナリフォーマットでシリアライズされたiseqのデータを文字列として返します。 RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
バイナリフォーマットでシリアライズされたiseqのデータを文字列として返します。
RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
引数の extra_data はバイナリデータと共に保存されます。
RubyVM::InstructionSequence.load_from_binary_extra_data メソッドでこの文字列にアクセス出来ます。
注意: 変換後のバイナリデータはポータブルではありません。 to_binary で得たバイナリデータは他のマシンに移動できません。他...