Class: EntityStore::EventDataObject
- Inherits:
-
Object
- Object
- EntityStore::EventDataObject
- Defined in:
- lib/entity_store/event_data_object.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #entity_type ⇒ Object
- #id ⇒ Object
-
#initialize(attrs = {}) ⇒ EventDataObject
constructor
A new instance of EventDataObject.
- #type ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ EventDataObject
Returns a new instance of EventDataObject.
5 6 7 |
# File 'lib/entity_store/event_data_object.rb', line 5 def initialize(attrs={}) @attrs = attrs end |
Instance Attribute Details
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
3 4 5 |
# File 'lib/entity_store/event_data_object.rb', line 3 def attrs @attrs end |
Instance Method Details
#[](key) ⇒ Object
21 22 23 |
# File 'lib/entity_store/event_data_object.rb', line 21 def [](key) attrs[key] end |
#entity_type ⇒ Object
13 14 15 |
# File 'lib/entity_store/event_data_object.rb', line 13 def entity_type attrs['_entity_type'] end |
#id ⇒ Object
9 10 11 |
# File 'lib/entity_store/event_data_object.rb', line 9 def id attrs['_id'].to_s end |
#type ⇒ Object
17 18 19 |
# File 'lib/entity_store/event_data_object.rb', line 17 def type attrs['_type'] end |