Module: Lelylan::Client::Location
- Included in:
- Lelylan::Client
- Defined in:
- lib/lelylan/client/location.rb
Instance Method Summary collapse
-
#create_location(params = {}) ⇒ Object
Public: Create a location and returns extended information for it.
-
#delete_location(id) ⇒ Object
Public: Delete a location identified from its ID and returns extended information for it.
-
#location(id) ⇒ Object
Public: Returns extended information for a given location identified from its ID.
-
#locations(params = {}) ⇒ Object
Public: Returns a list of owned locations.
-
#update_location(id, params = {}) ⇒ Object
Public: Update a location identified from its ID and returns extended information for it.
Instance Method Details
#create_location(params = {}) ⇒ Object
Public: Create a location and returns extended information for it.
params - The Hash used to create the resource (default: {}).
Returns Hashie The created location.
34 35 36 |
# File 'lib/lelylan/client/location.rb', line 34 def create_location(params = {}) post('/locations', params) end |
#delete_location(id) ⇒ Object
Public: Delete a location identified from its ID and returns extended information for it.
id - A String that represent the location ID.
Returns Hashie The deleted location.
57 58 59 |
# File 'lib/lelylan/client/location.rb', line 57 def delete_location(id) delete("/locations/#{id}") end |
#location(id) ⇒ Object
Public: Returns extended information for a given location identified from its ID.
id - A String that represent the location ID.
Returns Hashie The location.
12 13 14 |
# File 'lib/lelylan/client/location.rb', line 12 def location(id) get("/locations/#{id}") end |
#locations(params = {}) ⇒ Object
Public: Returns a list of owned locations.
params - The Hash used to refine the search (default: {}).
Returns Array List of locations.
23 24 25 |
# File 'lib/lelylan/client/location.rb', line 23 def locations(params = {}) get('/locations', params) end |
#update_location(id, params = {}) ⇒ Object
Public: Update a location identified from its ID and returns extended information for it.
id - A String that represent the location ID. params - The Hash used to update the resource (default: {}).
Returns Hashie The updated location.
46 47 48 |
# File 'lib/lelylan/client/location.rb', line 46 def update_location(id, params = {}) put("/locations/#{id}", params) end |