Class: NcsNavigator::Warehouse::DataMapper::NcsInteger

Inherits:
DataMapper::Property::Integer
  • Object
show all
Includes:
NcsType
Defined in:
lib/ncs_navigator/warehouse/data_mapper.rb

Overview

DataMapper :integer that's an NcsType.

Instance Method Summary collapse

Methods included from NcsType

#initialize

Instance Method Details

#typecast_to_primitive(value) ⇒ Object



69
70
71
72
73
74
75
# File 'lib/ncs_navigator/warehouse/data_mapper.rb', line 69

def typecast_to_primitive(value)
  if value.respond_to?(:to_str) && value.to_str =~ /\A\d+\Z/
    value.to_str.to_i
  else
    super
  end
end