Class: Geocoder::Result::Ip2location

Inherits:
Base
  • Object
show all
Defined in:
lib/geocoder/results/ip2location.rb

Instance Attribute Summary

Attributes inherited from Base

#cache_hit, #data

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#coordinates, #country, #country_code, #initialize, #latitude, #longitude, #province, #province_code, #state, #state_code

Constructor Details

This class inherits a constructor from Geocoder::Result::Base

Class Method Details

.response_attributesObject



10
11
12
13
14
# File 'lib/geocoder/results/ip2location.rb', line 10

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

Instance Method Details

#address(format = :full) ⇒ Object



6
7
8
# File 'lib/geocoder/results/ip2location.rb', line 6

def address(format = :full)
  "#{city_name} #{zip_code}, #{country_name}".sub(/^[ ,]*/, '')
end