るりまサーチ (Ruby 2.6.0)

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

別のキーワード

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

ライブラリ

クラス

検索結果

Psych::Nodes::Node#children -> [Psych::Nodes::Node] (87610.0)

子ノードの集合を配列で返します。

子ノードの集合を配列で返します。

Psych::Nodes::Node#tag -> String | nil (33094.0)

ノードに付加されたタグを返します。

ノードに付加されたタグを返します。

タグが付加されていない場合は 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