Class: SandthornDriverSequel2::Errors::ConcurrencyError
- Defined in:
- lib/sandthorn_driver_sequel_2/errors.rb
Instance Attribute Summary collapse
-
#aggregate ⇒ Object
readonly
Returns the value of attribute aggregate.
-
#event ⇒ Object
readonly
Returns the value of attribute event.
Instance Method Summary collapse
- #create_message ⇒ Object
-
#initialize(event, aggregate) ⇒ ConcurrencyError
constructor
A new instance of ConcurrencyError.
Constructor Details
#initialize(event, aggregate) ⇒ ConcurrencyError
Returns a new instance of ConcurrencyError.
9 10 11 12 13 |
# File 'lib/sandthorn_driver_sequel_2/errors.rb', line 9 def initialize(event, aggregate) @event = event @aggregate = aggregate super() end |
Instance Attribute Details
#aggregate ⇒ Object (readonly)
Returns the value of attribute aggregate.
8 9 10 |
# File 'lib/sandthorn_driver_sequel_2/errors.rb', line 8 def aggregate @aggregate end |
#event ⇒ Object (readonly)
Returns the value of attribute event.
8 9 10 |
# File 'lib/sandthorn_driver_sequel_2/errors.rb', line 8 def event @event end |
Instance Method Details
#create_message ⇒ Object
15 16 17 18 |
# File 'lib/sandthorn_driver_sequel_2/errors.rb', line 15 def "#{aggregate.aggregate_type} with id #{aggregate.aggregate_id}: " + "expected event with version #{aggregate.aggregate_version}, but got #{event.aggregate_version}" end |