Class: VanillaValidator::Rules::Min
- Defined in:
- lib/vanilla_validator/rules/min.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
8 9 10 |
# File 'lib/vanilla_validator/rules/min.rb', line 8 def I18n.t("min.string", attribute: attribute, min: parameters[0].to_i) end |
#valid? ⇒ Boolean
4 5 6 |
# File 'lib/vanilla_validator/rules/min.rb', line 4 def valid? value.length >= parameters[0].to_i end |