Class: ADT::ColumnType::Integer

Inherits:
Base
  • Object
show all
Defined in:
lib/adt/column_type.rb

Instance Method Summary collapse

Instance Method Details

#flagObject



58
59
60
# File 'lib/adt/column_type.rb', line 58

def flag
  'i'
end

#type_cast(value, _table) ⇒ Object



52
53
54
55
56
# File 'lib/adt/column_type.rb', line 52

def type_cast(value, _table)
  return nil if value.strip.empty?

  value.unpack('L').dig(0).to_i == 2_147_483_648 ? nil : value.unpack('L').dig(0).to_i
end