33件ヒット
[1-33件を表示]
(0.092秒)
検索結果
先頭3件
-
Psych
:: Nodes :: Node # children -> [Psych :: Nodes :: Node] (27301.0) -
子ノードの集合を配列で返します。
子ノードの集合を配列で返します。 -
Psych
:: Nodes :: Mapping (9006.0) -
YAML の mapping http://yaml.org/spec/1.1/#mapping を表すクラスです。
...YAML の mapping http://yaml.org/spec/1.1/#mapping を表すクラスです。
Psych::Nodes::Mapping は 0 個以上の子ノードを持つことができます。
子ノードの個数は偶数でなければなりません。
子ノードは以下のいずれかクラスのインスタンスで......せん。
* Psych::Nodes::Sequence
* Psych::Nodes::Mapping
* Psych::Nodes::Scalar
* Psych::Nodes::Alias
子ノードは mapping のキーと値が交互に並んでいます。
ast = Psych.parse(<<EOS)
%YAML 1.1
---
x: y
u: v
EOS
p ast.root.children.map{|v| v.value } # => [... -
Psych
:: Nodes :: Node # tag -> String | nil (3124.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...