Class: Psych::Pure::Emitter::Node
- Inherits:
-
Object
- Object
- Psych::Pure::Emitter::Node
- Defined in:
- lib/psych/pure.rb
Overview
The base class for all emitter nodes. We need to build a tree of nodes here in order to support dumping repeated objects as anchors and aliases, since we may find that we need to add an anchor after the object has already been flushed.
Direct Known Subclasses
AliasNode, ArrayNode, HashNode, NilNode, ObjectNode, OmapNode, SetNode, StringNode
Instance Attribute Summary collapse
-
#psych_node ⇒ Object
readonly
Returns the value of attribute psych_node.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(value, psych_node) ⇒ Node
constructor
A new instance of Node.
Constructor Details
#initialize(value, psych_node) ⇒ Node
Returns a new instance of Node.
4104 4105 4106 4107 4108 |
# File 'lib/psych/pure.rb', line 4104 def initialize(value, psych_node) @value = value @psych_node = psych_node @anchor = nil end |
Instance Attribute Details
#psych_node ⇒ Object (readonly)
Returns the value of attribute psych_node.
4102 4103 4104 |
# File 'lib/psych/pure.rb', line 4102 def psych_node @psych_node end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
4102 4103 4104 |
# File 'lib/psych/pure.rb', line 4102 def value @value end |
Instance Method Details
#accept(visitor) ⇒ Object
4110 4111 4112 |
# File 'lib/psych/pure.rb', line 4110 def accept(visitor) raise end |