Class: EasyLlama::Client::Locations
- Defined in:
- lib/easyllama/locations.rb
Overview
This class provides methods for interacting with the Easy Llama API for locations.
Constant Summary
Constants inherited from Api
Api::DEFAULT_API_VERSION, Api::DEFAULT_URI_BASE
Instance Method Summary collapse
-
#all(page: 1) ⇒ Array
Sends a GET request to retrieve all locations.
-
#create(location_attributes = {}) ⇒ Object
Sends a POST request to create a location.
Methods inherited from Api
#initialize, #parse_response!, #send_request
Constructor Details
This class inherits a constructor from EasyLlama::Client::Api
Instance Method Details
#all(page: 1) ⇒ Array
Sends a GET request to retrieve all locations.
11 12 13 14 15 |
# File 'lib/easyllama/locations.rb', line 11 def all(page: 1) response = send_request(path: '/locations', body: { page: }) parse_response!(response, 'locations') end |
#create(location_attributes = {}) ⇒ Object
Sends a POST request to create a location.
21 22 23 24 25 |
# File 'lib/easyllama/locations.rb', line 21 def create(location_attributes = {}) response = send_request(path: '/locations', method: :post, body: location_attributes) parse_response!(response, 'location') end |