Class: ActiveDomain::ProjectionRegistry
- Inherits:
-
Object
- Object
- ActiveDomain::ProjectionRegistry
- Includes:
- Singleton
- Defined in:
- lib/active_domain/projection_registry.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.invoke(event) ⇒ Object
14 15 16 |
# File 'lib/active_domain/projection_registry.rb', line 14 def self.invoke(event) instance.invoke event end |
.register(event_handler) ⇒ Object
10 11 12 |
# File 'lib/active_domain/projection_registry.rb', line 10 def self.register(event_handler) self.registry << event_handler end |
Instance Method Details
#invoke(event) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/active_domain/projection_registry.rb', line 18 def invoke(event) event_type = event.class.name.to_s return unless handlers.has_key? event_type handlers[event_type].each do |handler_method| handler_method.owner.new.send handler_method.name, event end end |