Class: Conditions::LessThanCondition
- Inherits:
-
BaseCondition
- Object
- BaseCondition
- Conditions::LessThanCondition
- Defined in:
- lib/conditions.rb
Overview
Checks if value is less than a predicate
Instance Method Summary collapse
- #apply(value) ⇒ true, false
-
#initialize(predicate) ⇒ LessThanCondition
constructor
A new instance of LessThanCondition.
Constructor Details
#initialize(predicate) ⇒ LessThanCondition
Returns a new instance of LessThanCondition.
144 145 146 147 148 |
# File 'lib/conditions.rb', line 144 def initialize(predicate) raise ConditionError, 'LessThan condition predicate must a number' unless predicate.is_a?(Numeric) super(predicate) end |
Instance Method Details
#apply(value) ⇒ true, false
154 155 156 |
# File 'lib/conditions.rb', line 154 def apply(value) value < @predicate end |