Class: Dry::Rules::MaxLength
- Defined in:
- lib/dry/rules/max_length.rb
Instance Attribute Summary
Attributes inherited from Dry::Rule
Instance Method Summary collapse
Methods inherited from Binary
Methods inherited from Dry::Rule
#+, #add_error, #and, #clone, #initialize, #or, #then
Constructor Details
This class inherits a constructor from Dry::Rule
Instance Method Details
#name ⇒ Object
14 15 16 |
# File 'lib/dry/rules/max_length.rb', line 14 def name 'max_length' end |
#valid? ⇒ Boolean
7 8 9 10 11 |
# File 'lib/dry/rules/max_length.rb', line 7 def valid? return true if left.size <= right add_error false end |