17件ヒット
[1-17件を表示]
(0.078秒)
クラス
検索結果
-
RubyVM
:: AbstractSyntaxTree :: Node # children -> Array (18114.0) -
self の子ノードを配列で返します。
...type によって異なります。
戻り値は、ほかの RubyVM::AbstractSyntaxTree::Node のインスタンスや nil を含みます。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.children
# => [[], nil, #<RubyVM::AbstractSyntaxTree::Node:OPCALL@1:0-1:5>]
//}... -
Psych
:: Nodes :: Node # tag -> String | nil (31.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...