Class: MemoryModel::Collection::MarshaledRecord
- Inherits:
-
Object
- Object
- MemoryModel::Collection::MarshaledRecord
- Defined in:
- lib/memory_model/collection/marshaled_record.rb
Instance Attribute Summary collapse
-
#string ⇒ Object
readonly
Returns the value of attribute string.
-
#uuid ⇒ Object
readonly
Returns the value of attribute uuid.
Instance Method Summary collapse
- #==(other_object) ⇒ Object
-
#initialize(record) ⇒ MarshaledRecord
constructor
A new instance of MarshaledRecord.
- #load ⇒ Object
Constructor Details
#initialize(record) ⇒ MarshaledRecord
Returns a new instance of MarshaledRecord.
7 8 9 10 11 |
# File 'lib/memory_model/collection/marshaled_record.rb', line 7 def initialize(record) @uuid = record._uuid_ @string = Marshal.dump record freeze end |
Instance Attribute Details
#string ⇒ Object (readonly)
Returns the value of attribute string.
5 6 7 |
# File 'lib/memory_model/collection/marshaled_record.rb', line 5 def string @string end |
#uuid ⇒ Object (readonly)
Returns the value of attribute uuid.
5 6 7 |
# File 'lib/memory_model/collection/marshaled_record.rb', line 5 def uuid @uuid end |
Instance Method Details
#==(other_object) ⇒ Object
17 18 19 |
# File 'lib/memory_model/collection/marshaled_record.rb', line 17 def ==(other_object) uuid == other_object.try(:uuid) end |
#load ⇒ Object
13 14 15 |
# File 'lib/memory_model/collection/marshaled_record.rb', line 13 def load Marshal.load @string end |