Class: Anony::Strategies::Destroy
- Inherits:
-
Object
- Object
- Anony::Strategies::Destroy
- Defined in:
- lib/anony/strategies/destroy.rb
Overview
The interface for configuring a destroy strategy. This strategy is not compatible with Anony::Strategies::Overwrite.
Instance Method Summary collapse
-
#apply(instance) ⇒ Object
Apply the Destroy strategy to the model instance.
-
#valid? ⇒ true
Whether the strategy is valid.
-
#validate! ⇒ true
Whether the strategy is valid, raising an exception if not.
Instance Method Details
#apply(instance) ⇒ Object
Apply the Destroy strategy to the model instance. In this case, it calls ‘#destroy!`.
33 34 35 36 |
# File 'lib/anony/strategies/destroy.rb', line 33 def apply(instance) instance.destroy! Result.destroyed end |
#valid? ⇒ true
Whether the strategy is valid. This strategy takes no configuration, so #valid? always returns true
17 18 19 |
# File 'lib/anony/strategies/destroy.rb', line 17 def valid? true end |
#validate! ⇒ true
Whether the strategy is valid, raising an exception if not. This strategy takes no configuration, so #validate! always returns true
25 26 27 |
# File 'lib/anony/strategies/destroy.rb', line 25 def validate! true end |