Sha256: 0e5b0cf44e71f131a4c468e69ad40a80dcdfb75d24c983484462e7805efcf449

Contents?: true

Size: 345 Bytes

Versions: 9

Compression:

Stored size: 345 Bytes

Contents

module Plucky
  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

9 entries across 9 versions & 1 rubygems

Version Path
plucky-0.8.0 lib/plucky/normalizers/integer.rb
plucky-0.7.0 lib/plucky/normalizers/integer.rb
plucky-0.6.6 lib/plucky/normalizers/integer.rb
plucky-0.6.5 lib/plucky/normalizers/integer.rb
plucky-0.6.4 lib/plucky/normalizers/integer.rb
plucky-0.6.3 lib/plucky/normalizers/integer.rb
plucky-0.6.2 lib/plucky/normalizers/integer.rb
plucky-0.6.1 lib/plucky/normalizers/integer.rb
plucky-0.6.0 lib/plucky/normalizers/integer.rb