Class: Rtype::Behavior::FloatCheck
- Inherits:
-
NumericCheck
- Object
- Base
- NumericCheck
- Rtype::Behavior::FloatCheck
- Defined in:
- lib/rtype/behavior/float_check.rb
Instance Method Summary collapse
Methods inherited from NumericCheck
Methods inherited from Base
Constructor Details
This class inherits a constructor from Rtype::Behavior::NumericCheck
Instance Method Details
#error_message(value) ⇒ Object
12 13 14 |
# File 'lib/rtype/behavior/float_check.rb', line 12 def (value) "Expected #{value.inspect} to be a float #{@condition} #{@x}" end |
#valid?(value) ⇒ Boolean
4 5 6 7 8 9 10 |
# File 'lib/rtype/behavior/float_check.rb', line 4 def valid?(value) if value.is_a?(Float) @lambda.call(value) else false end end |