Class: Geocoder::Result::Pointpin
- Inherits:
-
Base
- Object
- Base
- Geocoder::Result::Pointpin
show all
- Defined in:
- lib/geocoder/results/pointpin.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_code, #initialize, #latitude, #longitude, #province, #province_code
Class Method Details
.response_attributes ⇒ Object
30
31
32
|
# File 'lib/geocoder/results/pointpin.rb', line 30
def self.response_attributes
%w[continent_code ip country_code country_name region_name city_name postcode latitude longitude time_zone languages]
end
|
Instance Method Details
#address ⇒ Object
6
7
8
|
# File 'lib/geocoder/results/pointpin.rb', line 6
def address
[ city_name, state, postal_code, country ].select{ |i| i.to_s != "" }.join(", ")
end
|
#city ⇒ Object
10
11
12
|
# File 'lib/geocoder/results/pointpin.rb', line 10
def city
@data['city_name']
end
|
#country ⇒ Object
22
23
24
|
# File 'lib/geocoder/results/pointpin.rb', line 22
def country
@data['country_name']
end
|
#postal_code ⇒ Object
26
27
28
|
# File 'lib/geocoder/results/pointpin.rb', line 26
def postal_code
@data['postcode']
end
|
#state ⇒ Object
14
15
16
|
# File 'lib/geocoder/results/pointpin.rb', line 14
def state
@data['region_name']
end
|
#state_code ⇒ Object
18
19
20
|
# File 'lib/geocoder/results/pointpin.rb', line 18
def state_code
@data['region_code']
end
|