Class: Conditions::GreaterThanCondition
- Inherits:
-
BaseCondition
- Object
- BaseCondition
- Conditions::GreaterThanCondition
- Defined in:
- lib/conditions.rb
Overview
Checks if value is greater than a predicate
Instance Method Summary collapse
- #apply(value) ⇒ true, false
-
#initialize(predicate) ⇒ GreaterThanCondition
constructor
A new instance of GreaterThanCondition.
Constructor Details
#initialize(predicate) ⇒ GreaterThanCondition
Returns a new instance of GreaterThanCondition.
164 165 166 167 168 |
# File 'lib/conditions.rb', line 164 def initialize(predicate) raise ConditionError, 'GreaterThan condition predicate must a number' unless predicate.is_a?(Numeric) super(predicate) end |
Instance Method Details
#apply(value) ⇒ true, false
174 175 176 |
# File 'lib/conditions.rb', line 174 def apply(value) value > @predicate end |