Sha256: 3ecb94c6e1ca62f4f1e37120aeb2cc1c9cdf8e81dca183fec44dddbf9faf31e5
Contents?: true
Size: 639 Bytes
Versions: 5
Compression:
Stored size: 639 Bytes
Contents
module GoogleMaps module Geocoder class Result include Enumerable attr_accessor :status STATUS_CODES = [ "OK", "ZERO_RESULTS", "OVER_QUERY_LIMIT", "REQUEST_DENIED", "INVALID_REQUEST" ] def initialize(json = {}) self.status = ActiveSupport::StringInquirer.new(json['status'].downcase) @locations = (json['results'] || []).map { |result| Location.new(result) } end def all @locations end def each(&block) all.each &block end def [](index) all[index] end def last all.last end end end end
Version data entries
5 entries across 5 versions & 1 rubygems