Class: Lighthouse::Facilities::NearbyResponse
- Inherits:
-
Common::Base
- Object
- Common::Base
- Lighthouse::Facilities::NearbyResponse
- Defined in:
- lib/lighthouse/facilities/nearby_response.rb
Instance Attribute Summary
Attributes inherited from Common::Base
Instance Method Summary collapse
- #facilities ⇒ Object
-
#initialize(body, status) ⇒ NearbyResponse
constructor
A new instance of NearbyResponse.
Methods inherited from Common::Base
#changed, #changed?, #changes, default_sort, filterable_attributes, max_per_page, per_page, sortable_attributes
Constructor Details
#initialize(body, status) ⇒ NearbyResponse
Returns a new instance of NearbyResponse.
18 19 20 21 22 23 24 25 26 27 |
# File 'lib/lighthouse/facilities/nearby_response.rb', line 18 def initialize(body, status) super() self.body = body self.status = status parsed_body = JSON.parse(body) self.data = parsed_body['data'] self. = parsed_body['meta'] self.links = parsed_body['links'] # This endpoint is not currently responding with a JSONAPI meta element end |
Instance Method Details
#facilities ⇒ Object
29 30 31 32 33 |
# File 'lib/lighthouse/facilities/nearby_response.rb', line 29 def facilities data.map do |facility| Lighthouse::Facilities::NearbyFacility.new(facility) end end |