Class: Undo::Wrapper::Configuration
- Inherits:
-
Object
- Object
- Undo::Wrapper::Configuration
- Defined in:
- lib/undo/wrapper/configuration.rb
Instance Attribute Summary collapse
-
#store_on ⇒ Object
Returns the value of attribute store_on.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Configuration
constructor
A new instance of Configuration.
- #with(attribute_updates = {}) ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 |
# File 'lib/undo/wrapper/configuration.rb', line 6 def initialize(attributes = {}) @store_on = attributes.fetch :store_on, [:delete, :destroy] end |
Instance Attribute Details
#store_on ⇒ Object
Returns the value of attribute store_on.
4 5 6 |
# File 'lib/undo/wrapper/configuration.rb', line 4 def store_on @store_on end |
Instance Method Details
#with(attribute_updates = {}) ⇒ Object
10 11 12 |
# File 'lib/undo/wrapper/configuration.rb', line 10 def with(attribute_updates = {}) self.class.new store_on: (attribute_updates.delete(:store_on) || store_on) end |