Class: MarkMapper::Normalizers::Integer

Inherits:
Object
  • Object
show all
Defined in:
lib/mark_mapper/normalizers/integer.rb

Instance Method Summary collapse

Instance Method Details

#call(value) ⇒ Object

Public: Returns value coerced to integer or nil

value - The value to normalize to an integer

Returns an Integer or nil


10
11
12
13
14
15
16
# File 'lib/mark_mapper/normalizers/integer.rb', line 10

def call(value)
  if value.nil?
    nil
  else
    value.to_i
  end
end