検索結果
先頭5件
- Psych
:: Visitors :: YAMLTree . new(options = {} , emitter = Psych :: TreeBuilder . new , ss = Psych :: ScalarScanner . new) -> Psych :: Visitors :: YAMLTree - Psych
:: Nodes :: Stream . new(encoding = Psych :: Nodes :: Stream :: UTF8) -> Psych :: Nodes :: Stream - Psych
:: Stream . new(io) -> Psych :: Stream - Psych
:: TreeBuilder . new -> Psych :: TreeBuilder - Psych
:: Nodes :: Mapping . new(anchor=nil , tag=nil , implicit=true , style=BLOCK) -> Psych :: Nodes :: Mapping
-
Psych
:: Visitors :: YAMLTree . new(options = {} , emitter = Psych :: TreeBuilder . new , ss = Psych :: ScalarScanner . new) -> Psych :: Visitors :: YAMLTree (64516.0) -
YAMLTree オブジェクトを生成します。
...定します。
Psych.dump と同じオプションが指定できます。
emitter には AST の構築に使われる Psych::TreeBuilder オブジェクト
を渡します。
ss は Ruby の String が YAML document 上で quote が必要かどうか
を判定するための Psych::ScalarScanner......常デフォルトのものから変える必要はないでしょう。
@param options オプション
@param emitter AST の構築に使う Psych::TreeBuilder オブジェクト
@param ss 文字列に quite が必要かどうかを判定するための Psych::ScalarScanner オブジェクト... -
Psych
:: Nodes :: Stream . new(encoding = Psych :: Nodes :: Stream :: UTF8) -> Psych :: Nodes :: Stream (63910.0) -
Psych::Nodes::Stream オブジェクトを生成して返します。
...
Psych::Nodes::Stream オブジェクトを生成して返します。
encoding には stream に使われるエンコーディングを指定します。
以下のいずれかを指定します。
* Psych::Nodes::Node::UTF8
* Psych::Nodes::Node::UTF16BE
* Psych::Nodes::Node::UTF16LE
@param... -
Psych
:: Stream . new(io) -> Psych :: Stream (63610.0) -
新たな Stream オブジェクトを生成します。
新たな Stream オブジェクトを生成します。
io で YAML document の出力先を指定します。
@param io 出力先の IO オブジェクト -
Psych
:: TreeBuilder . new -> Psych :: TreeBuilder (63610.0) -
TreeBuilder オブジェクトを生成します。
TreeBuilder オブジェクトを生成します。 -
Psych
:: Nodes :: Mapping . new(anchor=nil , tag=nil , implicit=true , style=BLOCK) -> Psych :: Nodes :: Mapping (54610.0) -
新たな mapping オブジェクトを生成します。
...AML ドキュメント上の style を整数で指定します。以下のいずれ
かを指定できます。
* Psych::Nodes::Mapping::ANY
* Psych::Nodes::Mapping::BLOCK
* Psych::Nodes::Mapping::FLOW
@param anchor mapping に付加された anchor
@param tag mapping に付加された tag
@... -
Psych
:: Nodes :: Scalar . new(value , anchor=nil , tag=nil , plain=true , quoted=false , style=ANY) -> Psych :: Nodes:Scalar (54610.0) -
Scalar オブジェクトを生成します。
...します。
style は次の値のいずれかです。
* Psych::Nodes::Scalar::ANY
* Psych::Nodes::Scalar::PLAIN
* Psych::Nodes::Scalar::SINGLE_QUOTED
* Psych::Nodes::Scalar::DOUBLE_QUOTED
* Psych::Nodes::Scalar::LITERAL
* Psych::Nodes::Scalar::FOLDED
@param value スカラー値
@para... -
Psych
:: Nodes :: Sequence . new(anchor=nil , tag=nil , implicit=true , style=BLOCK) -> Psych :: Nodes :: Sequence (54610.0) -
新たな sequence オブジェクトを生成します。
...ML ドキュメント上の style を整数で指定します。以下のいずれ
かを指定できます。
* Psych::Nodes::Sequence::ANY
* Psych::Nodes::Sequence::BLOCK
* Psych::Nodes::Sequence::FLOW
@param anchor sequence に付加された anchor
@param tag sequence に付加された t... -
Psych
:: TreeBuilder (18079.0) -
YAML AST を構築するためのクラスです。
...す。
Psych::Parser.new に渡して YAML ドキュメントを YAML AST に変換する
ことができます。
また、Psych::Visitors::YAMLTree.new に渡して Ruby オブジェクト
を YAML AST に変換することもできます。
=== Example
parser = Psych::Parser.new Psych::Tree......Builder.new
parser.parse('--- foo')
parser.handler.root # => #<Psych::Nodes::Stream:0x00000001400000 ... >... -
Psych
:: Stream (18043.0) -
入力されたオブジェクトから変換された YAML document を指定した IO に出力する機能を持つクラスです。
...を完了します。
stream = Psych::Stream.new($stdout)
stream.start
stream.push({:foo => 'bar'})
stream.finish
YAML document は(バッファリングされずに)直接 $stdout に出力されます。
finish を確実に呼び出すためには Psych::Stream#start メソッドを
ブ......ロック付きで呼び出すとよいでしょう。
stream = Psych::Stream.new($stdout)
stream.start do |em|
em.push(:foo => 'bar')
end
基本的な仕組みは Psych::Visitors::YAMLTree と似ています。... -
Psych
:: Visitors :: YAMLTree (18025.0) -
Ruby オブジェクトから YAML の AST を構築するためのクラスです。
...クトから YAML の AST を構築するためのクラスです。
=== 例
builder = Psych::Visitors::YAMLTree.new
builder << { :foo => 'bar' }
builder << ["baz", "bazbaz"]
builder.tree # => #<Psych::Nodes::Stream ... > A stream containing two documents
puts tree.to_yaml
# =>
# ---... -
Psych
:: Stream # start(encoding = Psych :: Nodes :: Stream :: UTF8) -> Psych :: Stream (9625.0) -
Ruby オブジェクトを YAML document に変換するための準備をします。
...Ruby オブジェクトを YAML document に変換するための準備をします。
変換された document は Psych::Stream.new で指定した
出力先に出力されます。
finish を呼び出すことで出力が完了します(finish を呼び出さないと
最後まで出力され... -
Psych
:: Stream # start(encoding = Psych :: Nodes :: Stream :: UTF8) {|em| . . . } -> Psych :: Stream (9625.0) -
Ruby オブジェクトを YAML document に変換するための準備をします。
...Ruby オブジェクトを YAML document に変換するための準備をします。
変換された document は Psych::Stream.new で指定した
出力先に出力されます。
finish を呼び出すことで出力が完了します(finish を呼び出さないと
最後まで出力され... -
Psych
:: Nodes :: Stream :: UTF16BE -> Integer (9025.0) -
UTF16BE エンコーディングを表します。
...UTF16BE エンコーディングを表します。
Psych::Parser::UTF16BE と同じ値です。
@see Psych::Nodes::Stream.new... -
Psych
:: Nodes :: Stream :: UTF16LE -> Integer (9025.0) -
UTF16LE エンコーディングを表します。
...UTF16LE エンコーディングを表します。
Psych::Parser::UTF16LE と同じ値です。
@see Psych::Nodes::Stream.new... -
Psych
:: Nodes :: Stream :: UTF8 -> Integer (9025.0) -
UTF8 エンコーディングを表します。
...UTF8 エンコーディングを表します。
Psych::Parser::UTF8 と同じ値です。
@see Psych::Nodes::Stream.new... -
Psych
:: Nodes :: Document # tag _ directives -> [[String , String]] (625.0) -
tag directive の配列を返します。
...tag directive の配列を返します。
@see Psych::Nodes::Document#tag_directives=,
Psych::Nodes::Document.new... -
Psych
. dump(o , options = {}) -> String (343.0) -
Ruby のオブジェクト o を YAML ドキュメントに変換します。
...[例][ruby]{
# Dump an array, get back a YAML string
Psych.dump(['a', 'b']) # => "---\n- a\n- b\n"
# Dump an array to an IO object
Psych.dump(['a', 'b'], StringIO.new) # => #<StringIO:0x000001009d0890>
# Dump an array with indentation set
Psych.dump(['a', ['b']], :indentation => 3) # => "---\n-......a\n- - b\n"
# Dump an array to an IO with indentation set
Psych.dump(['a', ['b']], StringIO.new, :indentation => 3)
//}... -
Psych
:: Nodes :: Alias # anchor -> String (325.0) -
alias が指す先の anchor を返します。
...alias が指す先の anchor を返します。
@see Psych::Nodes::Alias#anchor=,
Psych::Nodes::Alias.new... -
Psych
:: Nodes :: Mapping # anchor -> String|nil (325.0) -
mapping に付加された anchor を返します。
...mapping に付加された anchor を返します。
@see Psych::Nodes::Mapping#anchor=,
Psych::Nodes::Mapping.new... -
Psych
:: Nodes :: Mapping # tag -> String|nil (325.0) -
mapping に付加された tag を返します。
...mapping に付加された tag を返します。
@see Psych::Nodes::Mapping#tag=,
Psych::Nodes::Mapping.new... -
Psych
:: Nodes :: Scalar # anchor -> String|nil (325.0) -
scalar に付加された anchor を返します。
...scalar に付加された anchor を返します。
@see Psych::Nodes::Scalar#anchor=,
Psych::Nodes::Scalar.new... -
Psych
:: Nodes :: Scalar # tag -> String|nil (325.0) -
scalar に付加された tag を返します。
...scalar に付加された tag を返します。
@see Psych::Nodes::Scalar#tag=,
Psych::Nodes::Scalar.new... -
Psych
:: Nodes :: Scalar # value -> String (325.0) -
scalar の値を返します。
...scalar の値を返します。
@see Psych::Nodes::Scalar#value=,
Psych::Nodes::Scalar.new... -
Psych
:: Nodes :: Sequence # anchor -> String|nil (325.0) -
sequence に付加された anchor を返します。
...sequence に付加された anchor を返します。
@see Psych::Nodes::Sequence#anchor=,
Psych::Nodes::Sequence.new... -
Psych
:: Nodes :: Sequence # tag -> String|nil (325.0) -
sequence に付加された tag を返します。
...sequence に付加された tag を返します。
@see Psych::Nodes::Sequence#tag=,
Psych::Nodes::Sequence.new... -
Psych
:: ScalarScanner # tokenize(string) -> object (325.0) -
YAML の scalar である文字列を Ruby のオブジェクトに変換した ものを返します。
...YAML の scalar である文字列を Ruby のオブジェクトに変換した
ものを返します。
scanner = Psych::ScalarScanner.new
p scanner.tokenize("yes") # => true
p scanner.tokenize("year") # => "year"
p scanner.tokenize("12") # => 12
@param string 変換文字列...