Module: EventSourcery::Postgres::Reactor::ClassMethods
- Defined in:
- lib/event_sourcery/postgres/reactor.rb
Instance Method Summary collapse
-
#emit_events ⇒ Array
An array of the types of events this reactor can emit.
-
#emits_event?(event_type) ⇒ true, false
Will check if this reactor emits the given type of event.
-
#emits_events(*event_types) ⇒ Object
Assign the types of events this reactor can emit.
-
#emits_events? ⇒ true, false
This will tell you if this reactor emits any type of event.
Instance Method Details
#emit_events ⇒ Array
Returns an array of the types of events this reactor can emit.
22 23 24 |
# File 'lib/event_sourcery/postgres/reactor.rb', line 22 def emit_events @emits_event_types ||= [] end |
#emits_event?(event_type) ⇒ true, false
Will check if this reactor emits the given type of event.
37 38 39 |
# File 'lib/event_sourcery/postgres/reactor.rb', line 37 def emits_event?(event_type) emit_events.include?(event_type) end |
#emits_events(*event_types) ⇒ Object
Assign the types of events this reactor can emit.
17 18 19 |
# File 'lib/event_sourcery/postgres/reactor.rb', line 17 def emits_events(*event_types) @emits_event_types = event_types end |
#emits_events? ⇒ true, false
This will tell you if this reactor emits any type of event.
29 30 31 |
# File 'lib/event_sourcery/postgres/reactor.rb', line 29 def emits_events? !emit_events.empty? end |