module AggregateRoot

Constants

MissingHandler
VERSION

Attributes

configuration[RW]

Public Class Methods

configure() { |configuration| ... } click to toggle source
# File lib/aggregate_root/configuration.rb, line 8
def self.configure
  self.configuration ||= Configuration.new
  yield(configuration)
end
included(host_class) click to toggle source
# File lib/aggregate_root.rb, line 67
def self.included(host_class)
  host_class.extend  OnDSL
  host_class.include AggregateRoot.with_strategy(->{ DefaultApplyStrategy.new })
end
with_default_apply_strategy() click to toggle source
# File lib/aggregate_root.rb, line 65
def self.with_default_apply_strategy
  Module.new do
    def self.included(host_class)
      host_class.extend  OnDSL
      host_class.include AggregateRoot.with_strategy(->{ DefaultApplyStrategy.new })
    end
  end
end
with_strategy(strategy) click to toggle source
# File lib/aggregate_root.rb, line 74
def self.with_strategy(strategy)
  Module.new do
    def self.included(host_class)
      host_class.extend  Constructor
      host_class.include AggregateMethods
    end

    define_method :apply_strategy do
      strategy.call
    end
  end
end