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

#alias?,
#children

The children of this node.

#document?,
#end_column

The column number where this node ends.

#end_line

The line number where this node ends.

#mapping?, #scalar?, #sequence?,
#start_column

The column number where this node start.

#start_line

The line number where this node start.

#stream?,
#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 32

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 25

attr_accessor :encoding

#stream?Boolean (readonly)

[ GitHub ]

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

def stream?; true; end