Module: ActiveEvent::EventType
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#attributes_except, #freeze, #initialize, #to_hash
Instance Attribute Details
#store_infos ⇒ Object
21
22
23
|
# File 'lib/active_event/event_type.rb', line 21
def store_infos
@store_infos ||= {}
end
|
Class Method Details
.create_instance(type, data) ⇒ Object
10
11
12
13
14
15
|
# File 'lib/active_event/event_type.rb', line 10
def self.create_instance(type, data)
Object.const_get(type).new(data)
rescue NameError
require 'ostruct'
OpenStruct.new(data.merge(event_type: type.to_s)).freeze
end
|
Instance Method Details
#add_store_infos(hash) ⇒ Object
17
18
19
|
# File 'lib/active_event/event_type.rb', line 17
def add_store_infos(hash)
store_infos.merge! hash
end
|
#event_type ⇒ Object
6
7
8
|
# File 'lib/active_event/event_type.rb', line 6
def event_type
self.class.name
end
|