Sha256: 46ac778c4ef1dba4744a9971f3499ad7798b640d9c7d474eeb5595bfda194df6
Contents?: true
Size: 727 Bytes
Versions: 24
Compression:
Stored size: 727 Bytes
Contents
require 'geocoder/results/base' module Geocoder::Result class Freegeoip < Base def address(format = :full) s = state_code.to_s == "" ? "" : ", #{state_code}" "#{city}#{s} #{postal_code}, #{country}".sub(/^[ ,]*/, "") end def city @data['city'] end def state @data['region_name'] end def state_code @data['region_code'] end def country @data['country_name'] end def country_code @data['country_code'] end def postal_code @data['zipcode'] end def self.response_attributes %w[metrocode ip] end response_attributes.each do |a| define_method a do @data[a] end end end end
Version data entries
24 entries across 24 versions & 4 rubygems