lib/aggregates/aggregate_root.rb
# Takes an event type and some parameters with which to create it. Then performs the following actions
#   1.) Builds the final event object.
#   2.) Processes the event locally on the aggregate.
#   3.) Produces the event on the event stream so that is saved by the storage backend and processed
#       by the configured processors of the given type.
Takes an event type and some parameters with which to create it. Then performs the following actions
1.) Builds the final event object.
2.) Processes the event locally on the aggregate.
3.) Produces the event on the event stream so that is saved by the storage backend and processed
by the configured processors of the given type.
Takes an event type and some parameters with which to create it . Then performs the following actions 1 . ) Builds the final event object . 2 . ) Processes the event locally on the aggregate . 3 . ) Produces the event on the event stream so that is saved by the storage backend and processed by the configured processors of the given type .
def apply(event, params = {})
      event = build_event(event, params)
      results = process_event(event)
      @event_stream.publish(event)
      results
    end
def apply ( event , params = { } ) event = build_event ( event , params ) results = process_event ( event ) @event_stream . publish ( event ) results end
Takes an event type and some parameters with which to create it.
Takes an event type and some parameters with which to create it .
event
<not_specific>
params
<not_specific>