Class: Psych::Pure::LoadedObject
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Psych::Pure::LoadedObject
- Defined in:
- lib/psych/pure.rb
Overview
Wraps a Ruby object with its node from the source input.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#dirty ⇒ Object
readonly
Whether or not this object has been modified.
-
#psych_node ⇒ Object
readonly
The node associated with the object.
Instance Method Summary collapse
-
#initialize(object, psych_node) ⇒ LoadedObject
constructor
A new instance of LoadedObject.
- #initialize_clone(obj, freeze: nil) ⇒ Object
- #initialize_dup(obj) ⇒ Object
Constructor Details
#initialize(object, psych_node) ⇒ LoadedObject
Returns a new instance of LoadedObject.
225 226 227 228 229 |
# File 'lib/psych/pure.rb', line 225 def initialize(object, psych_node) super(object) @psych_node = psych_node @dirty = false end |
Instance Attribute Details
#dirty ⇒ Object (readonly)
Whether or not this object has been modified. If it has, then we cannot rely on the source formatting, and need to format it ourselves.
223 224 225 |
# File 'lib/psych/pure.rb', line 223 def dirty @dirty end |
#psych_node ⇒ Object (readonly)
The node associated with the object.
219 220 221 |
# File 'lib/psych/pure.rb', line 219 def psych_node @psych_node end |
Instance Method Details
#initialize_clone(obj, freeze: nil) ⇒ Object
231 232 233 234 |
# File 'lib/psych/pure.rb', line 231 def initialize_clone(obj, freeze: nil) super @psych_node = obj.psych_node.dup end |
#initialize_dup(obj) ⇒ Object
236 237 238 239 |
# File 'lib/psych/pure.rb', line 236 def initialize_dup(obj) super @psych_node = obj.psych_node.dup end |