Sha256: a5f2524c50be18fdf8cd2dc1c714da786623cdaad355b82916845470a6fba135

Contents?: true

Size: 349 Bytes

Versions: 6

Compression:

Stored size: 349 Bytes

Contents

module MarkMapper
  module Normalizers
    class Integer

      # Public: Returns value coerced to integer or nil
      #
      # value - The value to normalize to an integer
      #
      # Returns an Integer or nil
      def call(value)
        if value.nil?
          nil
        else
          value.to_i
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mark_mapper-0.0.6 lib/mark_mapper/normalizers/integer.rb
mark_mapper-0.0.5 lib/mark_mapper/normalizers/integer.rb
mark_mapper-0.0.4 lib/mark_mapper/normalizers/integer.rb
mark_mapper-0.0.3 lib/mark_mapper/normalizers/integer.rb
mark_mapper-0.0.2 lib/mark_mapper/normalizers/integer.rb
mark_mapper-0.0.1 lib/mark_mapper/normalizers/integer.rb