るりまサーチ

最速Rubyリファレンスマニュアル検索!
11件ヒット [1-11件を表示] (0.216秒)
トップページ > クエリ:I[x] > クエリ:E[x] > クエリ:tag[x] > クラス:Psych::Nodes::Node[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. matrix i

ライブラリ

検索結果

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

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

...されていない場合は nil を返します。

ast = Psych.parse(<<EOS)
---
- !!str a
- b
E
OS

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...