Class: ActiveQuery::Types::Integer

Inherits:
Base
  • Object
show all
Defined in:
lib/active_query/types/integer.rb

Class Method Summary collapse

Class Method Details

.coerce(value) ⇒ Object



10
11
12
13
14
# File 'lib/active_query/types/integer.rb', line 10

def self.coerce(value)
  ::Kernel.Integer(value, 10)
rescue ArgumentError, TypeError
  value
end

.valid?(value) ⇒ Boolean

Returns:



6
7
8
# File 'lib/active_query/types/integer.rb', line 6

def self.valid?(value)
  value.is_a?(::Integer)
end