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
-
ANY =
# File 'ext/psych/lib/psych/nodes/stream.rb', line 13
Any encoding
Psych::Parser::ANY
-
UTF16BE =
# File 'ext/psych/lib/psych/nodes/stream.rb', line 22
UTF-16BE encoding
Psych::Parser::UTF16BE
-
UTF16LE =
# File 'ext/psych/lib/psych/nodes/stream.rb', line 19
UTF-16LE encoding
Psych::Parser::UTF16LE
-
UTF8 =
# File 'ext/psych/lib/psych/nodes/stream.rb', line 16
UTF-8 encoding
Psych::Parser::UTF8
Class Method Summary
- .new(encoding = UTF8) ⇒ Stream constructor
Node - Inherited
Instance Attribute Summary
-
#encoding
rw
The encoding used for this stream.
- #stream? ⇒ Boolean readonly
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
Instance Attribute Details
#encoding (rw)
The encoding used for this stream
# 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