るりまサーチ

最速Rubyリファレンスマニュアル検索!
33件ヒット [1-33件を表示] (0.050秒)
トップページ > クエリ:String#tr[x] > クエリ:type[x] > クエリ:input[x] > クラス:Psych::Nodes::Node[x]

別のキーワード

  1. << rexml::attribute#name
  2. add rexml::attribute#name
  3. handle_interrupt thread#raise
  4. inspect? irb::context#inspect_mode
  5. service drb::extserv#stop_service

ライブラリ

キーワード

検索結果

Psych::Nodes::Node#to_yaml(io=nil, options={}) -> String | IO (203.0)

AST を YAML ドキュメントに変換します。

...て返します。

io を省略した(nil を指定した)場合には変換後のドキュメントを
文字列で返します。

Psych::Nodes::Stream 以外を変換しようとすると、AST として不正で
あるためエラーが発生します。

options には以下が指定できま...

Psych::Nodes::Node#yaml(io=nil, options={}) -> String | IO (203.0)

AST を YAML ドキュメントに変換します。

...て返します。

io を省略した(nil を指定した)場合には変換後のドキュメントを
文字列で返します。

Psych::Nodes::Stream 以外を変換しようとすると、AST として不正で
あるためエラーが発生します。

options には以下が指定できま...

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