Sha256: 7c65fd264b4ddca4e6e4950cd81af762776f989965463b2dd281003b4a50a47a
Contents?: true
Size: 593 Bytes
Versions: 25
Compression:
Stored size: 593 Bytes
Contents
require 'geocoder/results/base' module Geocoder::Result class Ip2location < Base def address(format = :full) "#{city_name} #{zip_code}, #{country_name}".sub(/^[ ,]*/, '') end def self.response_attributes %w[country_code country_name region_name city_name latitude longitude zip_code time_zone isp domain net_speed idd_code area_code usage_type weather_station_code weather_station_name mcc mnc mobile_brand elevation] end response_attributes.each do |attr| define_method attr do @data[attr] || "" end end end end
Version data entries
25 entries across 25 versions & 2 rubygems