Class: Integer

Inherits:
Object show all
Defined in:
lib/presenter/types.rb

Class Method Summary collapse

Class Method Details

.typecast(value) ⇒ Object



24
25
26
27
# File 'lib/presenter/types.rb', line 24

def self.typecast(value)
  value_to_i = value.to_i
  value_to_i == 0 && value.to_s !~ /^(0x|0b)?0+/ ? nil : value_to_i
end