Class: GdsApi::Mapit::Location
- Inherits:
-
Object
- Object
- GdsApi::Mapit::Location
- Defined in:
- lib/gds_api/mapit.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #areas ⇒ Object
-
#initialize(response) ⇒ Location
constructor
A new instance of Location.
- #lat ⇒ Object
- #lon ⇒ Object
- #postcode ⇒ Object
Constructor Details
#initialize(response) ⇒ Location
Returns a new instance of Location.
18 19 20 |
# File 'lib/gds_api/mapit.rb', line 18 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
16 17 18 |
# File 'lib/gds_api/mapit.rb', line 16 def response @response end |
Instance Method Details
#areas ⇒ Object
30 31 32 |
# File 'lib/gds_api/mapit.rb', line 30 def areas @response['areas'].map {|i, area| OpenStruct.new(area) } end |
#lat ⇒ Object
22 23 24 |
# File 'lib/gds_api/mapit.rb', line 22 def lat @response['wgs84_lat'] end |
#lon ⇒ Object
26 27 28 |
# File 'lib/gds_api/mapit.rb', line 26 def lon @response['wgs84_lon'] end |
#postcode ⇒ Object
34 35 36 |
# File 'lib/gds_api/mapit.rb', line 34 def postcode @response['postcode'] end |