Module: Nearmiss::Client::Categories
- Defined in:
- lib/toolhound-ruby/client/categories.rb
Overview
Methods for the Categories API
Instance Method Summary collapse
-
#categories(options = {}) ⇒ Array<Sawyer::Resource>
(also: #list_categories, #list_cats, #cats)
List categories.
-
#category(category, options = {}) ⇒ Sawyer::Resource
(also: #cat)
Get a single category.
-
#create_category(options = {}) ⇒ Sawyer::Resource
(also: #create_cat)
Create a category.
-
#delete_category(category, options = {}) ⇒ Boolean
(also: #delete_cat, #remove_category, #remove_cat)
Delete a category.
-
#edit_category(category, options = {}) ⇒ Object
(also: #edit_cat)
Edit a category.
Instance Method Details
#categories(options = {}) ⇒ Array<Sawyer::Resource> Also known as: list_categories, list_cats, cats
List categories
11 12 13 |
# File 'lib/toolhound-ruby/client/categories.rb', line 11 def categories( = {}) paginate "categories", end |
#category(category, options = {}) ⇒ Sawyer::Resource Also known as: cat
Get a single category
23 24 25 |
# File 'lib/toolhound-ruby/client/categories.rb', line 23 def category(category, ={}) get "categories/#{category}", end |
#create_category(options = {}) ⇒ Sawyer::Resource Also known as: create_cat
Create a category
34 35 36 |
# File 'lib/toolhound-ruby/client/categories.rb', line 34 def create_category( = {}) post 'categories', end |
#delete_category(category, options = {}) ⇒ Boolean Also known as: delete_cat, remove_category, remove_cat
Delete a category
62 63 64 |
# File 'lib/toolhound-ruby/client/categories.rb', line 62 def delete_category(category, = {}) boolean_from_response :delete, "categories/#{category}", end |
#edit_category(category, options = {}) ⇒ Object Also known as: edit_cat
Edit a category
51 52 53 |
# File 'lib/toolhound-ruby/client/categories.rb', line 51 def edit_category(category, = {}) patch "categories/#{category}", end |