Method: DBF::ColumnType::SignedLong2#type_cast

Defined in:
lib/dbf/column_type.rb

#type_cast(value) ⇒ Object

Parameters:

[View source] [View on GitHub]

46
47
48
49
50
# File 'lib/dbf/column_type.rb', line 46

def type_cast(value)
  s = value.unpack1('B*')
  sign_multiplier = s[0] == '0' ? -1 : 1
  s[1, 31].to_i(2) * sign_multiplier
end