Sha256: 0c50caf330559499fbccd2e0629bc10e5a972c6b87bfaad26f5f6490a9d5f7e2

Contents?: true

Size: 280 Bytes

Versions: 1

Compression:

Stored size: 280 Bytes

Contents

# frozen_string_literal: true

module Normalizy
  module Filters
    module Number
      def self.call(input)
        return input unless input.is_a?(String)

        value = input.gsub(/\D/, '')

        return nil if value.blank?

        value.to_i
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
normalizy-0.1.0 lib/normalizy/filters/number.rb