Module: Akasha::SyntaxHelpers

Included in:
Aggregate
Defined in:
lib/akasha/aggregate/syntax_helpers.rb

Overview

Adds syntax sugar to aggregates.

Initialize using the `connect!` method:

repository = Akasha::Repository.new(Akasha::Storage::MemoryEventStore.new)
Aggregate.connect!(repository)

Example usage:

item = Item.find_or_create('item-1')
... modify item ..
item.save!

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object


14
15
16
17
# File 'lib/akasha/aggregate/syntax_helpers.rb', line 14

def self.included(base)
  base.include(InstanceMethods)
  base.extend(ClassMethods)
end