Class: DSLCompose::DSL::Arguments::Argument::EqualToValidation
- Inherits:
-
Object
- Object
- DSLCompose::DSL::Arguments::Argument::EqualToValidation
- Defined in:
- lib/dsl_compose/dsl/arguments/argument/equal_to_validation.rb
Defined Under Namespace
Classes: ValidationFailedError
Instance Method Summary collapse
-
#initialize(value) ⇒ EqualToValidation
constructor
A new instance of EqualToValidation.
- #validate!(value) ⇒ Object
Constructor Details
#initialize(value) ⇒ EqualToValidation
Returns a new instance of EqualToValidation.
11 12 13 |
# File 'lib/dsl_compose/dsl/arguments/argument/equal_to_validation.rb', line 11 def initialize value @value = value end |
Instance Method Details
#validate!(value) ⇒ Object
15 16 17 18 |
# File 'lib/dsl_compose/dsl/arguments/argument/equal_to_validation.rb', line 15 def validate! value raise ValidationFailedError, "The argument is invalid. Expected #{@value} but received #{value}" unless value == @value true end |