Class: EventSorcerer::AggregateCreator
- Inherits:
-
Object
- Object
- EventSorcerer::AggregateCreator
- Defined in:
- lib/event_sorcerer/aggregate_creator.rb
Overview
Public: Service class for building new aggregates.
Instance Method Summary collapse
-
#create ⇒ Object
Public: Wraps and returns aggregate in a new AggregateProxy.
-
#initialize(klass, id) ⇒ AggregateCreator
constructor
Public: Creates a new AggregateCreator instance.
Constructor Details
#initialize(klass, id) ⇒ AggregateCreator
Public: Creates a new AggregateCreator instance.
klass - class for the aggregate to be created. id - desired id for the aggregate to be created.
8 9 10 11 |
# File 'lib/event_sorcerer/aggregate_creator.rb', line 8 def initialize(klass, id) @id = id @klass = klass end |
Instance Method Details
#create ⇒ Object
Public: Wraps and returns aggregate in a new AggregateProxy.
14 15 16 |
# File 'lib/event_sorcerer/aggregate_creator.rb', line 14 def create AggregateProxy.new(aggregate) end |