Class: GdsApi::Mapit::Location
- Inherits:
-
Object
- Object
- GdsApi::Mapit::Location
- Defined in:
- lib/gds_api/mapit.rb
Instance Attribute Summary collapse
- #response ⇒ Object readonly
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.
21 22 23 |
# File 'lib/gds_api/mapit.rb', line 21 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
19 20 21 |
# File 'lib/gds_api/mapit.rb', line 19 def response @response end |
Instance Method Details
#areas ⇒ Object
33 34 35 |
# File 'lib/gds_api/mapit.rb', line 33 def areas @response["areas"].map { |_i, area| OpenStruct.new(area) } end |
#lat ⇒ Object
25 26 27 |
# File 'lib/gds_api/mapit.rb', line 25 def lat @response["wgs84_lat"] end |
#lon ⇒ Object
29 30 31 |
# File 'lib/gds_api/mapit.rb', line 29 def lon @response["wgs84_lon"] end |
#postcode ⇒ Object
37 38 39 |
# File 'lib/gds_api/mapit.rb', line 37 def postcode @response["postcode"] end |