要約
YAML AST のノードを表す抽象クラスです。
このクラスをインスタンス化することは不適切です。すべてのノードのクラスはこのクラスの派生クラスです。
目次
継承しているメソッド
- Enumerableから継承しているメソッド
 - 
  
- all?
 - any?
 - chain
 - chunk
 - chunk_while
 - collect
 - collect_concat
 - count
 - cycle
 - detect
 - drop
 - drop_while
 - each_cons
 - each_entry
 - each_slice
 - each_with_index
 - each_with_object
 - entries
 - filter
 - filter_map
 - find
 - find_all
 - find_index
 - first
 - flat_map
 - grep
 - grep_v
 - group_by
 - include?
 - inject
 - lazy
 - map
 - max
 - max_by
 - member?
 - min
 - min_by
 - minmax
 - minmax_by
 - none?
 - one?
 - partition
 - reduce
 - reject
 - reverse_each
 - select
 - slice_after
 - slice_before
 - slice_when
 - sort
 - sort_by
 - sum
 - take
 - take_while
 - tally
 - to_a
 - to_h
 - uniq
 - zip
 
 
インスタンスメソッド
children -> [Psych::Nodes::Node][permalink][rdoc][edit]- 
子ノードの集合を配列で返します。
 each -> Enumerator[permalink][rdoc][edit]each {|node| ... } -> ()- 
self のノードをルートとする部分木の各ノードを引数としてブロックを呼び出します。
ブロックを省略した場合は Enumerator を返します。
 tag -> String | nil[permalink][rdoc][edit]- 
ノードに付加されたタグを返します。
タグが付加されていない場合は nil を返します。
ast = Psych.parse(<<EOS) --- - !!str a - b EOS p ast.root.children[0].value # => "a" p ast.root.children[0].tag # => "tag:yaml.org,2002:str" p ast.root.children[1].value # => "b" p ast.root.children[1].tag # => nil
 to_ruby -> object[permalink][rdoc][edit]transform -> object- 
AST を ruby のオブジェクトに変換します。
 yaml(io=nil, options={}) -> String | IO[permalink][rdoc][edit]to_yaml(io=nil, options={}) -> String | IO- 
AST を YAML ドキュメントに変換します。
io に IO オブジェクトを指定した場合は、そのオブジェクトに変換後のドキュメントが書き込まれます。この場合は io を返り値として返します。
io を省略した(nil を指定した)場合には変換後のドキュメントを文字列で返します。
Psych::Nodes::Stream 以外を変換しようとすると、AST として不正であるためエラーが発生します。
options には以下が指定できます。
- :version
 - 
YAML document に付加するバージョンを [major, minor] という配列、もしくは文字列で指定します
 - :header
 - 
出力にヘッダを付けるかどうかを真偽値で指定します
 - :indentation
 - 
インデントのレベルを 1 から 9 までの整数で指定します
 - :canonical
 - 
出力の style が canonical であるかどうかを真偽値で指定します
 - :line_width
 - 
「好ましい」行幅を整数値で指定します
 
- [PARAM] io:
 - 書き込み先の IO
 - [PARAM] options:
 - オプション