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



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

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