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.
24 25 26 |
# File 'lib/event_sourcery/postgres/reactor.rb', line 24 def emit_events @emits_event_types ||= [] end |
#emits_event?(event_type) ⇒ true, false
Will check if this reactor emits the given type of event.
39 40 41 |
# File 'lib/event_sourcery/postgres/reactor.rb', line 39 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.
19 20 21 |
# File 'lib/event_sourcery/postgres/reactor.rb', line 19 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.
31 32 33 |
# File 'lib/event_sourcery/postgres/reactor.rb', line 31 def emits_events? !emit_events.empty? end |