Sha256: 710cf1bf196b1b62f7d6df2b79a2832817cf5bf5e7e3f6dea3464e417772d0cc

Contents?: true

Size: 609 Bytes

Versions: 8

Compression:

Stored size: 609 Bytes

Contents

module Barometer
  module Query
    module Converter
      class FromShortZipcodeToZipcode
        def self.from
          [:short_zipcode]
        end

        def initialize(query)
          @query = query
        end

        def call
          return unless can_convert?
          @query.add_conversion(:zipcode, @query.get_conversion(:short_zipcode).q)
        end

        private

        def can_convert?
          !!@query.get_conversion(*self.class.from)
        end
      end
    end
  end
end

Barometer::Query::Converter.register(:zipcode, Barometer::Query::Converter::FromShortZipcodeToZipcode)

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
barometer-0.9.7 lib/barometer/query/converters/from_short_zipcode_to_zipcode.rb
barometer-0.9.6 lib/barometer/query/converters/from_short_zipcode_to_zipcode.rb
barometer-0.9.5 lib/barometer/query/converters/from_short_zipcode_to_zipcode.rb
barometer-0.9.4 lib/barometer/query/converters/from_short_zipcode_to_zipcode.rb
barometer-0.9.3 lib/barometer/query/converters/from_short_zipcode_to_zipcode.rb
barometer-0.9.2 lib/barometer/query/converters/from_short_zipcode_to_zipcode.rb
barometer-0.9.1 lib/barometer/query/converters/from_short_zipcode_to_zipcode.rb
barometer-0.9.0 lib/barometer/query/converters/from_short_zipcode_to_zipcode.rb