Class: Rtype::Behavior::IntegerCheck
- Inherits:
-
NumericCheck
- Object
- Base
- NumericCheck
- Rtype::Behavior::IntegerCheck
- Defined in:
- lib/rtype/behavior/integer_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/integer_check.rb', line 12 def (value) "Expected #{value.inspect} to be an integer #{@condition} #{@x}" end |
#valid?(value) ⇒ Boolean
4 5 6 7 8 9 10 |
# File 'lib/rtype/behavior/integer_check.rb', line 4 def valid?(value) if value.is_a?(Integer) @lambda.call(value) else false end end |