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