Class: DBI::Type::Integer

Inherits:
Varchar
  • Object
show all
Defined in:
lib/dbi/types.rb

Overview

Represents a whole number. Falls back to Varchar.

Direct Known Subclasses

Float

Class Method Summary collapse

Class Method Details

.parse(obj) ⇒ Object



72
73
74
75
76
# File 'lib/dbi/types.rb', line 72

def self.parse(obj)
    return nil if Null.parse(obj).nil?
    return obj.to_i if obj.respond_to? :to_i
    super 
end