Sha256: 2e3c27fddc23358d222965bb48ad921f8df1a03f9d443d9a71ff0c1dae750377

Contents?: true

Size: 581 Bytes

Versions: 46

Compression:

Stored size: 581 Bytes

Contents

require 'geocoder/results/base'

module Geocoder::Result
  class GeocoderUs < Base
    def coordinates
      [@data[0].to_f, @data[1].to_f]
    end

    def address(format = :full)
      "#{street_address}, #{city}, #{state} #{postal_code}, #{country}".sub(/^[ ,]*/, "")
    end

    def street_address
      @data[2]
    end

    def city
      @data[3]
    end

    def state
      @data[4]
    end

    alias_method :state_code, :state

    def postal_code
      @data[5]
    end

    def country
      'United States'
    end

    def country_code
      'US'
    end
  end
end

Version data entries

46 entries across 46 versions & 6 rubygems

Version Path
geocoder-1.5.2 lib/geocoder/results/geocoder_us.rb
really-broken-geocoder-2.0.0 lib/geocoder/results/geocoder_us.rb
really-broken-geocoder-1.5.1 lib/geocoder/results/geocoder_us.rb
geocoder-1.5.1 lib/geocoder/results/geocoder_us.rb
geocoder-1.5.0 lib/geocoder/results/geocoder_us.rb
geocoder-1.4.9 lib/geocoder/results/geocoder_us.rb
geocoder-1.4.8 lib/geocoder/results/geocoder_us.rb
geocoder-1.4.7 lib/geocoder/results/geocoder_us.rb
geocoder-1.4.6 lib/geocoder/results/geocoder_us.rb
geocoder-1.4.5 lib/geocoder/results/geocoder_us.rb
geocoder-1.4.4 lib/geocoder/results/geocoder_us.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/geocoder-1.4.3/lib/geocoder/results/geocoder_us.rb
geocoder-1.4.3 lib/geocoder/results/geocoder_us.rb
geocoder-1.4.2 lib/geocoder/results/geocoder_us.rb
geocoder-1.4.1 lib/geocoder/results/geocoder_us.rb
geocoder-1.4.0 lib/geocoder/results/geocoder_us.rb
geocoder-1.3.7 lib/geocoder/results/geocoder_us.rb
geocoder-1.3.6 lib/geocoder/results/geocoder_us.rb
geocoder-1.3.5 lib/geocoder/results/geocoder_us.rb
broken-geocoder-1.3.6 lib/geocoder/results/geocoder_us.rb