Class: Tpt::Rails::ApplicationEvent
- Inherits:
-
Object
- Object
- Tpt::Rails::ApplicationEvent
- Includes:
- ActiveModel::Serializers::JSON
- Defined in:
- app/models/tpt/rails/application_event.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
- #attributes ⇒ Object
- #event_type ⇒ Object
-
#initialize(data, metadata: {}) ⇒ ApplicationEvent
constructor
A new instance of ApplicationEvent.
Constructor Details
#initialize(data, metadata: {}) ⇒ ApplicationEvent
Returns a new instance of ApplicationEvent.
5 6 7 8 |
# File 'app/models/tpt/rails/application_event.rb', line 5 def initialize(data, metadata: {}) @data = data || {} @metadata = end |
Instance Method Details
#==(other) ⇒ Object
14 15 16 |
# File 'app/models/tpt/rails/application_event.rb', line 14 def ==(other) @data == other.data end |
#attributes ⇒ Object
18 19 20 |
# File 'app/models/tpt/rails/application_event.rb', line 18 def attributes data.merge(metadata: ) end |
#event_type ⇒ Object
10 11 12 |
# File 'app/models/tpt/rails/application_event.rb', line 10 def event_type self.class.name.demodulize.gsub(/Event$/, '') end |