Class: Rollgeist::Mark
- Inherits:
-
Object
- Object
- Rollgeist::Mark
- Defined in:
- lib/rollgeist/mark.rb
Constant Summary collapse
- ACTIONS =
%i[create update destroy].freeze
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#changed_attributes ⇒ Object
readonly
Returns the value of attribute changed_attributes.
-
#rollback_location ⇒ Object
readonly
Returns the value of attribute rollback_location.
-
#rolled_back_at ⇒ Object
readonly
Returns the value of attribute rolled_back_at.
Instance Method Summary collapse
-
#initialize(action:, changed_attributes:, rollback_location:, rolled_back_at:) ⇒ Mark
constructor
A new instance of Mark.
Constructor Details
#initialize(action:, changed_attributes:, rollback_location:, rolled_back_at:) ⇒ Mark
Returns a new instance of Mark.
9 10 11 12 13 14 15 16 17 |
# File 'lib/rollgeist/mark.rb', line 9 def initialize(action:, changed_attributes:, rollback_location:, rolled_back_at:) raise ArgumentError, "unsupported rollback action: #{action}" unless ACTIONS.include?(action) @action = action @changed_attributes = changed_attributes.map(&:to_s).uniq.freeze @rollback_location = rollback_location @rolled_back_at = rolled_back_at freeze end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
7 8 9 |
# File 'lib/rollgeist/mark.rb', line 7 def action @action end |
#changed_attributes ⇒ Object (readonly)
Returns the value of attribute changed_attributes.
7 8 9 |
# File 'lib/rollgeist/mark.rb', line 7 def changed_attributes @changed_attributes end |
#rollback_location ⇒ Object (readonly)
Returns the value of attribute rollback_location.
7 8 9 |
# File 'lib/rollgeist/mark.rb', line 7 def rollback_location @rollback_location end |
#rolled_back_at ⇒ Object (readonly)
Returns the value of attribute rolled_back_at.
7 8 9 |
# File 'lib/rollgeist/mark.rb', line 7 def rolled_back_at @rolled_back_at end |