Class: SDL4R::Serializer::Ref
- Inherits:
-
Object
- Object
- SDL4R::Serializer::Ref
- Defined in:
- lib/sdl4r/serializer.rb
Overview
Represents a reference to an object during serialization or deserialization. Used in order to avoid infinite cycles, repetitions, etc.
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#o ⇒ Object
readonly
Returns the value of attribute o.
-
#oid ⇒ Object
readonly
Returns the value of attribute oid.
-
#tag ⇒ Object
Returns the value of attribute tag.
Instance Method Summary collapse
-
#inc ⇒ Object
Increments the reference counter by one.
-
#initialize(o, oid) ⇒ Ref
constructor
Initializes a reference with a reference counter of 0.
Constructor Details
#initialize(o, oid) ⇒ Ref
Initializes a reference with a reference counter of 0.
89 90 91 92 93 94 |
# File 'lib/sdl4r/serializer.rb', line 89 def initialize(o, oid) @tag = nil @o = o @oid = oid @count = 0 end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
84 85 86 |
# File 'lib/sdl4r/serializer.rb', line 84 def count @count end |
#o ⇒ Object (readonly)
Returns the value of attribute o.
84 85 86 |
# File 'lib/sdl4r/serializer.rb', line 84 def o @o end |
#oid ⇒ Object (readonly)
Returns the value of attribute oid.
84 85 86 |
# File 'lib/sdl4r/serializer.rb', line 84 def oid @oid end |
#tag ⇒ Object
Returns the value of attribute tag.
85 86 87 |
# File 'lib/sdl4r/serializer.rb', line 85 def tag @tag end |
Instance Method Details
#inc ⇒ Object
Increments the reference counter by one.
98 99 100 |
# File 'lib/sdl4r/serializer.rb', line 98 def inc @count += 1 end |