Class: Dry::Rules::LengthEqual
- Defined in:
- lib/dry/rules/length_equal.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
permalink #name ⇒ Object
[View source]
12 13 14 |
# File 'lib/dry/rules/length_equal.rb', line 12 def name 'length_equal' end |
permalink #valid? ⇒ Boolean
5 6 7 8 9 |
# File 'lib/dry/rules/length_equal.rb', line 5 def valid? return true if left.size == right add_error false end |