Class: Nandi::Validation::RemoveIndexValidator
- Inherits:
-
Object
- Object
- Nandi::Validation::RemoveIndexValidator
- Includes:
- FailureHelpers
- Defined in:
- lib/nandi/validation/remove_index_validator.rb
Instance Attribute Summary collapse
-
#instruction ⇒ Object
readonly
Returns the value of attribute instruction.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(instruction) ⇒ RemoveIndexValidator
constructor
A new instance of RemoveIndexValidator.
Methods included from FailureHelpers
#assert, #collect_errors, #failure, #success
Constructor Details
#initialize(instruction) ⇒ RemoveIndexValidator
Returns a new instance of RemoveIndexValidator.
14 15 16 |
# File 'lib/nandi/validation/remove_index_validator.rb', line 14 def initialize(instruction) @instruction = instruction end |
Instance Attribute Details
#instruction ⇒ Object (readonly)
Returns the value of attribute instruction.
27 28 29 |
# File 'lib/nandi/validation/remove_index_validator.rb', line 27 def instruction @instruction end |
Class Method Details
.call(instruction) ⇒ Object
10 11 12 |
# File 'lib/nandi/validation/remove_index_validator.rb', line 10 def self.call(instruction) new(instruction).call end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/nandi/validation/remove_index_validator.rb', line 18 def call opts = instruction.extra_args assert( opts.key?(:name) || opts.key?(:column), "remove_index: requires a `name` or `column` argument", ) end |