Module: Unidata::Extensions::Integer

Included in:
Integer
Defined in:
lib/unidata/extensions/integer.rb

Instance Method Summary collapse

Instance Method Details

#from_unidata(value) ⇒ Object



12
13
14
# File 'lib/unidata/extensions/integer.rb', line 12

def from_unidata(value)
  typecast(value)
end

#to_unidata(value) ⇒ Object



8
9
10
# File 'lib/unidata/extensions/integer.rb', line 8

def to_unidata(value)
  value
end

#typecast(value) ⇒ Object



4
5
6
# File 'lib/unidata/extensions/integer.rb', line 4

def typecast(value)
  value.kind_of?(::Integer) ? value : value.to_i
end