Class: BookingLocations::Api
- Inherits:
-
Object
- Object
- BookingLocations::Api
- Defined in:
- lib/booking_locations/api.rb
Instance Method Summary collapse
Instance Method Details
#all ⇒ Object
12 13 14 15 |
# File 'lib/booking_locations/api.rb', line 12 def all response = open("#{api_uri}/api/v1/booking_locations.json", ) JSON.parse(response.read) end |
#get(id) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/booking_locations/api.rb', line 5 def get(id) response = open("#{api_uri}/api/v1/booking_locations/#{id}.json", ) yield JSON.parse(response.read) rescue OpenURI::HTTPError nil end |