2件ヒット
[1-2件を表示]
(0.019秒)
クラス
- Object (1)
-
Psych
:: Nodes :: Document (1)
検索結果
先頭2件
-
Psych
:: Nodes :: Document . new(version=[] , tag _ directives=[] , implicit=false) -> Psych :: Nodes :: Document (54349.0) -
Document オブジェクトを生成します。
...YAML 1.1 のドキュメントで、
tag directive を1つ持ち、 implicit にドキュメントが開始
している Document オブジェクトを生成しています。
Psych::Nodes::Document.new(
[1,1],
tenderlovemaking.com,2009:",
true)
@see Psych::Handler#start_document... -
Object
. yaml _ tag(tag) -> () (64.0) -
クラスと tag の間を関連付けます。
...g 対象のクラスに関連付けるタグの文字列
=== Example
require 'psych'
class Foo
def initialize(x)
@x = x
end
attr_reader :x
end
# Dumps Ruby object normally
p Psych.dump(Foo.new(3))
# =>
# --- !ruby/object:Foo
# x: 3
# Registers tag......yaml_as("tag:example.com,2013:foo")
# ... and dumps the object of Foo class
Psych.dump(Foo.new(3), STDOUT)
# =>
# --- !<tag:example.com,2013:foo>
# x: 3
# Loads the object from the tagged YAML node
p Psych.load(<<EOS)
--- !<tag:example.com,2012:foo>
x: 8
EOS
# => #<Foo:0x00...