Sha256: 283c8774dda9f26f131788e9466dbdcc370c75c958da2d7db1cff2874035090d

Contents?: true

Size: 354 Bytes

Versions: 6

Compression:

Stored size: 354 Bytes

Contents

module Barometer
  module Query
    module Format
      #
      # eg. 90210 or 90210-5555
      #
      class Zipcode < Base
        def self.geo(query); {country_code: 'US'}; end
        def self.regex; /(^[0-9]{5}$)|(^[0-9]{5}-[0-9]{4}$)/; end
      end
    end
  end
end

Barometer::Query::Format.register(:zipcode, Barometer::Query::Format::Zipcode)

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
barometer-0.9.7 lib/barometer/query/formats/zipcode.rb
barometer-0.9.6 lib/barometer/query/formats/zipcode.rb
barometer-0.9.5 lib/barometer/query/formats/zipcode.rb
barometer-0.9.4 lib/barometer/query/formats/zipcode.rb
barometer-0.9.3 lib/barometer/query/formats/zipcode.rb
barometer-0.9.2 lib/barometer/query/formats/zipcode.rb