Class: SandthornDriverSequel2::Errors::WrongSnapshotVersionError
- Defined in:
- lib/sandthorn_driver_sequel_2/errors.rb
Instance Attribute Summary collapse
-
#aggregate ⇒ Object
readonly
Returns the value of attribute aggregate.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #create_message ⇒ Object
-
#initialize(aggregate, version) ⇒ WrongSnapshotVersionError
constructor
A new instance of WrongSnapshotVersionError.
Constructor Details
#initialize(aggregate, version) ⇒ WrongSnapshotVersionError
Returns a new instance of WrongSnapshotVersionError.
37 38 39 40 41 |
# File 'lib/sandthorn_driver_sequel_2/errors.rb', line 37 def initialize(aggregate, version) @aggregate = aggregate @version = version super() end |
Instance Attribute Details
#aggregate ⇒ Object (readonly)
Returns the value of attribute aggregate.
36 37 38 |
# File 'lib/sandthorn_driver_sequel_2/errors.rb', line 36 def aggregate @aggregate end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
36 37 38 |
# File 'lib/sandthorn_driver_sequel_2/errors.rb', line 36 def version @version end |
Instance Method Details
#create_message ⇒ Object
43 44 45 46 |
# File 'lib/sandthorn_driver_sequel_2/errors.rb', line 43 def "#{aggregate[:aggregate_type]} with id #{aggregate[:aggregate_id]}: tried to save snapshot with version "+ "#{version}, but current version is at #{aggregate[:aggregate_version]}" end |