39件ヒット
[1-39件を表示]
(0.126秒)
ライブラリ
- ビルトイン (6)
- psych (22)
-
rexml
/ document (11)
クラス
-
Psych
:: Nodes :: Node (22) -
REXML
:: Element (11) -
RubyVM
:: AbstractSyntaxTree :: Node (6)
検索結果
先頭4件
-
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...