Class: Synapse::Serialization::SerializedObject
- Inherits:
-
Object
- Object
- Synapse::Serialization::SerializedObject
- Defined in:
- lib/synapse/serialization/serialized_object.rb
Direct Known Subclasses
Instance Attribute Summary collapse
- #content ⇒ Object readonly
- #content_type ⇒ Class readonly
- #type ⇒ SerializedType readonly
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
- #initialize(content, content_type, type) ⇒ undefined constructor
Constructor Details
#initialize(content, content_type, type) ⇒ undefined
17 18 19 20 21 |
# File 'lib/synapse/serialization/serialized_object.rb', line 17 def initialize(content, content_type, type) @content = content @content_type = content_type @type = type end |
Instance Attribute Details
#content ⇒ Object (readonly)
5 6 7 |
# File 'lib/synapse/serialization/serialized_object.rb', line 5 def content @content end |
#content_type ⇒ Class (readonly)
8 9 10 |
# File 'lib/synapse/serialization/serialized_object.rb', line 8 def content_type @content_type end |
#type ⇒ SerializedType (readonly)
11 12 13 |
# File 'lib/synapse/serialization/serialized_object.rb', line 11 def type @type end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
23 24 25 26 27 28 |
# File 'lib/synapse/serialization/serialized_object.rb', line 23 def ==(other) self.class === other and other.content == @content and other.content_type == @content_type and other.type == @type end |
#hash ⇒ Object
32 33 34 |
# File 'lib/synapse/serialization/serialized_object.rb', line 32 def hash @content.hash ^ @content_type.hash ^ @type.hash end |