class Aggregates::Domain

Defines the collection of command processors, event processors, and command filters that are executed together.

Attributes

command_filters[R]
command_processors[R]
event_processors[R]

Public Class Methods

new() click to toggle source
# File lib/aggregates/domain.rb, line 12
def initialize
  @command_processors = []
  @event_processors = []
  @command_filters = []
end

Public Instance Methods

execute_with(storage_backend) click to toggle source
# File lib/aggregates/domain.rb, line 36
def execute_with(storage_backend)
  DomainExecutor.new(storage_backend, self)
end
filter_commands_with(*command_filters) click to toggle source
# File lib/aggregates/domain.rb, line 30
def filter_commands_with(*command_filters)
  command_filters.each do |command_filter|
    @command_filters << command_filter
  end
end
process_commands_with(*command_processors) click to toggle source
# File lib/aggregates/domain.rb, line 24
def process_commands_with(*command_processors)
  command_processors.each do |command_processor|
    @command_processors << command_processor
  end
end
process_events_with(*event_processors) click to toggle source
# File lib/aggregates/domain.rb, line 18
def process_events_with(*event_processors)
  event_processors.each do |event_processor|
    @event_processors << event_processor
  end
end