Sha256: b8c0d10d0474e1dafc01c2053cc684aaa0322cacbe256ac06863148f240886ca
Contents?: true
Size: 773 Bytes
Versions: 37
Compression:
Stored size: 773 Bytes
Contents
require 'geocoder/results/base' module Geocoder::Result class Telize < 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'] end def state_code @data['region_code'] end def country @data['country'] end def country_code @data['country_code'] end def postal_code @data['postal_code'] end def self.response_attributes %w[timezone isp dma_code area_code ip asn continent_code country_code3] end response_attributes.each do |a| define_method a do @data[a] end end end end
Version data entries
37 entries across 37 versions & 5 rubygems