class SandthornDriverSequel::Errors::ConcurrencyError

Attributes

aggregate[R]
event[R]

Public Class Methods

new(event, aggregate) click to toggle source
Calls superclass method
# File lib/sandthorn_driver_sequel/errors.rb, line 9
def initialize(event, aggregate)
  @event = event
  @aggregate = aggregate
  super(create_message)
end

Public Instance Methods

create_message() click to toggle source
# File lib/sandthorn_driver_sequel/errors.rb, line 15
def create_message
  "#{aggregate.aggregate_type} with id #{aggregate.aggregate_id}: " +
  "expected event with version #{aggregate.aggregate_version}, but got #{event.aggregate_version}"
end