Class: Geocoder::Result::BaiduIp
- Inherits:
-
Base
- Object
- Base
- Geocoder::Result::BaiduIp
show all
- Defined in:
- lib/geocoder/results/baidu_ip.rb
Instance Attribute Summary
Attributes inherited from Base
#cache_hit, #data
Instance Method Summary
collapse
Methods inherited from Base
#initialize, #latitude, #longitude, #province_code
Instance Method Details
#address ⇒ Object
9
10
11
|
# File 'lib/geocoder/results/baidu_ip.rb', line 9
def address
@data['address']
end
|
#city ⇒ Object
21
22
23
|
# File 'lib/geocoder/results/baidu_ip.rb', line 21
def city
address_detail['city']
end
|
#coordinates ⇒ Object
5
6
7
|
# File 'lib/geocoder/results/baidu_ip.rb', line 5
def coordinates
[point['y'].to_f, point['x'].to_f]
end
|
#country ⇒ Object
45
46
47
|
# File 'lib/geocoder/results/baidu_ip.rb', line 45
def country
"China"
end
|
#country_code ⇒ Object
49
50
51
|
# File 'lib/geocoder/results/baidu_ip.rb', line 49
def country_code
"CN"
end
|
#district ⇒ Object
25
26
27
|
# File 'lib/geocoder/results/baidu_ip.rb', line 25
def district
address_detail['district']
end
|
#postal_code ⇒ Object
41
42
43
|
# File 'lib/geocoder/results/baidu_ip.rb', line 41
def postal_code
""
end
|
#province ⇒ Object
17
18
19
|
# File 'lib/geocoder/results/baidu_ip.rb', line 17
def province
address_detail['province']
end
|
#state ⇒ Object
13
14
15
|
# File 'lib/geocoder/results/baidu_ip.rb', line 13
def state
province
end
|
#state_code ⇒ Object
37
38
39
|
# File 'lib/geocoder/results/baidu_ip.rb', line 37
def state_code
""
end
|
#street ⇒ Object
29
30
31
|
# File 'lib/geocoder/results/baidu_ip.rb', line 29
def street
address_detail['street']
end
|
#street_number ⇒ Object
33
34
35
|
# File 'lib/geocoder/results/baidu_ip.rb', line 33
def street_number
address_detail['street_number']
end
|