123456789_123456789_123456789_123456789_123456789_

Class: Psych::Nodes::Stream

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Node
Instance Chain:
self, Node, Enumerable
Inherits: Psych::Nodes::Node
Defined in: ext/psych/lib/psych/nodes/stream.rb

Overview

Represents a YAML stream. This is the root node for any YAML parse tree. This node must have one or more child nodes. The only valid child node for a Stream node is Document.

Constant Summary

Class Method Summary

Node - Inherited

.new

Create a new Node

Instance Attribute Summary

Node - Inherited

#children

The children of this node.

#tag

An associated tag.

Instance Method Summary

Node - Inherited

#each

Iterate over each node in the tree.

#to_ruby

Convert this node to Ruby.

#to_yaml
#transform
#yaml

Convert this node to YAML.

Constructor Details

.new(encoding = UTF8) ⇒ Stream

Create a new Stream node with an #encoding that defaults to UTF8.

See also Handler#start_stream

[ GitHub ]

  
# File 'ext/psych/lib/psych/nodes/stream.rb', line 31

def initialize encoding = UTF8
  super()
  @encoding = encoding
end

Instance Attribute Details

#encoding (rw)

The encoding used for this stream

[ GitHub ]

  
# File 'ext/psych/lib/psych/nodes/stream.rb', line 24

attr_accessor :encoding