Class: Dry::Rules::LessThan

Inherits:
Binary show all
Defined in:
lib/dry/rules/less_than.rb

Instance Attribute Summary

Attributes inherited from Dry::Rule

#args, #errors, #value

Instance Method Summary collapse

Methods inherited from Binary

#left, #right

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

#nameObject



14
15
16
# File 'lib/dry/rules/less_than.rb', line 14

def name
  'lt'
end

#valid?Boolean

Returns:



7
8
9
10
11
# File 'lib/dry/rules/less_than.rb', line 7

def valid?
  return true if left < right
  add_error
  false
end