Class: Geocoder::Result::Ip2locationLite
- Inherits:
-
Base
- Object
- Base
- Geocoder::Result::Ip2locationLite
show all
- Defined in:
- lib/geocoder/results/ip2location_lite.rb
Instance Attribute Summary
Attributes inherited from Base
#cache_hit, #data
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
#address, #initialize, #latitude, #longitude, #province, #province_code
Class Method Details
.response_attributes ⇒ Object
34
35
36
37
38
39
|
# File 'lib/geocoder/results/ip2location_lite.rb', line 34
def self.response_attributes
%w[country_short country_long region latitude longitude isp
domain netspeed areacode iddcode timezone zipcode weatherstationname
weatherstationcode mcc mnc mobilebrand elevation usagetype addresstype
category district asn as]
end
|
Instance Method Details
#city ⇒ Object
10
11
12
|
# File 'lib/geocoder/results/ip2location_lite.rb', line 10
def city
@data[:city]
end
|
#coordinates ⇒ Object
6
7
8
|
# File 'lib/geocoder/results/ip2location_lite.rb', line 6
def coordinates
[@data[:latitude], @data[:longitude]]
end
|
#country ⇒ Object
22
23
24
|
# File 'lib/geocoder/results/ip2location_lite.rb', line 22
def country
@data[:country_long]
end
|
#country_code ⇒ Object
26
27
28
|
# File 'lib/geocoder/results/ip2location_lite.rb', line 26
def country_code
@data[:country_short]
end
|
#postal_code ⇒ Object
30
31
32
|
# File 'lib/geocoder/results/ip2location_lite.rb', line 30
def postal_code
@data[:zipcode]
end
|
#state ⇒ Object
14
15
16
|
# File 'lib/geocoder/results/ip2location_lite.rb', line 14
def state
@data[:region]
end
|
#state_code ⇒ Object
18
19
20
|
# File 'lib/geocoder/results/ip2location_lite.rb', line 18
def state_code
"" end
|