Sha256: 38f0a19df46702504aaa000f35db03e91055be765a31a65760a09b487a346813

Contents?: true

Size: 462 Bytes

Versions: 9

Compression:

Stored size: 462 Bytes

Contents

# encoding: UTF-8
module Graticule #:nodoc:
  module Geocoder #:nodoc:
    # Bogus geocoder that can be used for test purposes
    class Bogus
      # A queue of canned responses
      class_attribute :responses
      self.responses = []

      # A default location to use if the responses queue is empty
      class_attribute :default

      def locate(address)
        responses.shift || default || Location.new(:street => address)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
graticule-2.7.2 lib/graticule/geocoder/bogus.rb
graticule-2.7.1 lib/graticule/geocoder/bogus.rb
graticule-2.7.0 lib/graticule/geocoder/bogus.rb
graticule-2.6.0 lib/graticule/geocoder/bogus.rb
graticule-2.5.0 lib/graticule/geocoder/bogus.rb
graticule-2.4.0 lib/graticule/geocoder/bogus.rb
graticule-2.3.0 lib/graticule/geocoder/bogus.rb
graticule-2.2.0 lib/graticule/geocoder/bogus.rb
graticule-2.1.0 lib/graticule/geocoder/bogus.rb