Module: Siilar::Client::Tags
- Included in:
- TagsService
- Defined in:
- lib/siilar/client/tags.rb
Instance Method Summary collapse
-
#create_tag_collection(attributes = {}) ⇒ Object
Create a tag collection.
-
#delete_tag_collection(collection) ⇒ Object
Delete a tag collection.
-
#edit_tag_collection(collection, attributes = {}) ⇒ Object
Edit a tag collection.
-
#find_tags(attributes = {}) ⇒ Object
Find tags.
-
#tag_collection(collection) ⇒ Object
Get one tag collection.
-
#tag_collections ⇒ Object
Get all the tag collections.
Instance Method Details
#create_tag_collection(attributes = {}) ⇒ Object
Create a tag collection
26 27 28 29 30 31 |
# File 'lib/siilar/client/tags.rb', line 26 def create_tag_collection(attributes = {}) Extra.validate_mandatory_attributes(attributes, [:name]) response = client.post('1.0/tag-collections', attributes) Struct::TagCollection.new(response) end |
#delete_tag_collection(collection) ⇒ Object
Delete a tag collection
45 46 47 |
# File 'lib/siilar/client/tags.rb', line 45 def delete_tag_collection(collection) client.delete("1.0/tag-collections/#{collection}") end |
#edit_tag_collection(collection, attributes = {}) ⇒ Object
Edit a tag collection
36 37 38 39 40 |
# File 'lib/siilar/client/tags.rb', line 36 def edit_tag_collection(collection, attributes = {}) response = client.patch("1.0/tag-collections/#{collection}", attributes) Struct::TagCollection.new(response) end |
#find_tags(attributes = {}) ⇒ Object
Find tags
52 53 54 55 56 |
# File 'lib/siilar/client/tags.rb', line 52 def (attributes = {}) response = client.get('1.0/tags', attributes) Struct::Tag.new(response) end |
#tag_collection(collection) ⇒ Object
Get one tag collection
17 18 19 20 21 |
# File 'lib/siilar/client/tags.rb', line 17 def tag_collection(collection) response = client.get("1.0/tag-collections/#{collection}") Struct::TagCollection.new(response) end |
#tag_collections ⇒ Object
Get all the tag collections
8 9 10 11 12 |
# File 'lib/siilar/client/tags.rb', line 8 def tag_collections response = client.get('1.0/tag-collections') response.map { |r| Struct::TagCollection.new(r) } end |