class TuneupTechnology::Locations
The Locations
object
Attributes
base_url[R]
make_http_request[R]
Public Class Methods
new(base_url, make_http_request)
click to toggle source
# File lib/tuneuptechnology/locations.rb, line 8 def initialize(base_url, make_http_request) @base_url = base_url @make_http_request = make_http_request end
Public Instance Methods
all()
click to toggle source
Retrieve all location records
# File lib/tuneuptechnology/locations.rb, line 20 def all endpoint = "#{@base_url}/locations" Client.make_http_request('get', endpoint) end
create(data)
click to toggle source
Create a location
# File lib/tuneuptechnology/locations.rb, line 14 def create(data) endpoint = "#{@base_url}/locations" Client.make_http_request('post', endpoint, data) end
delete(id)
click to toggle source
Delete a location record
# File lib/tuneuptechnology/locations.rb, line 38 def delete(id) endpoint = "#{@base_url}/locations/#{id}" Client.make_http_request('delete', endpoint) end
retrieve(id)
click to toggle source
Retrieve a single location record
# File lib/tuneuptechnology/locations.rb, line 26 def retrieve(id) endpoint = "#{@base_url}/locations/#{id}" Client.make_http_request('get', endpoint) end
update(id, data)
click to toggle source
Update a location record
# File lib/tuneuptechnology/locations.rb, line 32 def update(id, data) endpoint = "#{@base_url}/locations/#{id}" Client.make_http_request('patch', endpoint, data) end