Class: VanillaValidator::Rules::Like
- Defined in:
- lib/vanilla_validator/rules/like.rb
Instance Attribute Summary
Attributes inherited from BaseRule
#attribute, #parameters, #value
Instance Method Summary collapse
Methods inherited from BaseRule
Constructor Details
This class inherits a constructor from VanillaValidator::Rules::BaseRule
Instance Method Details
#failure_message ⇒ Object
9 10 11 |
# File 'lib/vanilla_validator/rules/like.rb', line 9 def I18n.t('like', attribute: attribute, other_attribute: parameters[0]) end |
#valid? ⇒ Boolean
4 5 6 7 |
# File 'lib/vanilla_validator/rules/like.rb', line 4 def valid? other_value = ValueExtractor.get(VanillaValidator.raw_input, parameters[0]) value == other_value end |