るりまサーチ

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

別のキーワード

  1. rexml/document node_type
  2. node each
  3. tsort tsort_each_node
  4. node yaml

ライブラリ

キーワード

検索結果

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

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

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

RubyVM::AbstractSyntaxTree::Node#children -> Array (21132.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>]
//}...

REXML::Element#root_node -> REXML::Document | REXML::Node (6263.0)

self が属する文書のルートノードを返します。

...<children>
<grandchildren />
</children>
</root>
EOS

children
= doc.get_elements("/root/children").first
children
.name # => "children"
children
.root_node == doc # => true
grandchildren = doc.get_elements("/root/children/grandchildren").first
grandchildren.name # => "grandchildren"
grandchildren....
...root_node == doc # => true
//}...

Psych::Nodes::Node#tag -> String | nil (6025.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...