るりまサーチ

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

別のキーワード

  1. psych new
  2. psych any
  3. psych tag
  4. psych anchor
  5. psych dump

クラス

キーワード

検索結果

<< 1 2 > >>

Psych::Nodes::Stream.new(encoding = Psych::Nodes::Stream::UTF8) -> Psych::Nodes::Stream (32563.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 (32321.0)

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

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

io で YAML document の出力先を指定します。

@param io 出力先の IO オブジェクト...

Psych::Stream (29092.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::Stream#start(encoding = Psych::Nodes::Stream::UTF8) -> Psych::Stream (14434.0)

Ruby オブジェクトを YAML document に変換するための準備をします。

... Psych::Stream.new で指定した
出力先に出力されます。

finish を呼び出すことで出力が完了します(finish を呼び出さないと
最後まで出力されない場合があります)。

ブロック付きで start を呼び出すと、変換準備を終えた Stream...

Psych::Stream#start(encoding = Psych::Nodes::Stream::UTF8) {|em| ... } -> Psych::Stream (14434.0)

Ruby オブジェクトを YAML document に変換するための準備をします。

... Psych::Stream.new で指定した
出力先に出力されます。

finish を呼び出すことで出力が完了します(finish を呼び出さないと
最後まで出力されない場合があります)。

ブロック付きで start を呼び出すと、変換準備を終えた Stream...

絞り込み条件を変える

Psych::Nodes::Stream::UTF16BE -> Integer (14026.0)

UTF16BE エンコーディングを表します。

...UTF16BE エンコーディングを表します。

Psych
::Parser::UTF16BE と同じ値です。

@see Psych::Nodes::Stream.new...

Psych::Nodes::Stream::UTF16LE -> Integer (14026.0)

UTF16LE エンコーディングを表します。

...UTF16LE エンコーディングを表します。

Psych
::Parser::UTF16LE と同じ値です。

@see Psych::Nodes::Stream.new...

Psych::Nodes::Stream::UTF8 -> Integer (14026.0)

UTF8 エンコーディングを表します。

...UTF8 エンコーディングを表します。

Psych
::Parser::UTF8 と同じ値です。

@see Psych::Nodes::Stream.new...

Psych::Nodes (11240.0)

Psych が中間データとして利用している AST (Abstract Syntax Tree) に 関するモジュール。

...Psych が中間データとして利用している AST (Abstract Syntax Tree) に
関するモジュール。

Psych
.load によって YAML ドキュメントを Ruby オブジェクトに変換
するときには、一度中間的な AST に変換され、その AST が Ruby の
オブジェクト...
...

逆向き、つまり Psych.dump で Ruby のオブジェクトを
YAML ドキュメントに変換するときには、中間的な AST に変換してから
それを YAML ドキュメントに変換します。

YAML AST の各ノードのクラスはすべて Psych::Nodes の下にありま...
...# Create our nodes
stream
= Psych::Nodes::Stream.new
doc = Psych::Nodes::Document.new
seq = Psych::Nodes::Sequence.new
scalar = Psych::Nodes::Scalar.new('foo')

# Build up our tree
stream
.children << doc
doc.children << seq
seq.children << scalar

stream
は AST のルー...

Psych::Emitter (11120.0)

Psych::Parser でパースし、生じたイベントから YAML ドキュメントを再構築するようなハンドラです。

...Psych::Parser でパースし、生じたイベントから
YAML ドキュメントを再構築するようなハンドラです。

以下の例では STDIN から YAML ドキュメントを入力し、
再構築した YAML ドキュメントを STDERR に出力します。

parser = Psych::Pars...
...er.new(Psych::Emitter.new($stderr))
parser.parse($stdin)

また、以下のようにイベントを手動で発生させることで
YAML ドキュメントを構築させることもできます。
各メソッドの意味については Psych::Handler を参照してください。
require 'p...
...output = StringIO.new
emitter = Psych::Emitter.new(output)

emitter.start_stream(Psych::Parser::UTF8)
emitter.start_document([1, 1], [], false)
emitter.start_mapping(nil, nil, false, Psych::Nodes::Mapping::BLOCK)
emitter.scalar("a", nil, nil, true, false, Psych::Nodes::Scalar::PLAIN...

絞り込み条件を変える

<< 1 2 > >>