Class: Tenk::Projects::Tags
- Inherits:
-
Object
- Object
- Tenk::Projects::Tags
- Defined in:
- lib/projects/tags.rb
Overview
API methods for attaching and removing tags from a project
Defined Under Namespace
Classes: ListRequest
Instance Method Summary collapse
-
#add(project_id, tag) ⇒ Hashie::Mash
Attach a tag to a project.
-
#initialize(client) ⇒ Tags
constructor
Initialize a Tenk::Projects::Tag resource API wrapper for the given client.
-
#list(project_id) ⇒ Hashie::Mash
List Tags for a single project.
-
#remove(project_id, tag_id) ⇒ Hashie::Mash
Remove a tag from a project.
Constructor Details
#initialize(client) ⇒ Tags
Initialize a Tenk::Projects::Tag resource API wrapper for the given client
16 17 18 |
# File 'lib/projects/tags.rb', line 16 def initialize(client) @_client = client end |
Instance Method Details
#add(project_id, tag) ⇒ Hashie::Mash
Attach a tag to a project
32 33 34 |
# File 'lib/projects/tags.rb', line 32 def add(project_id, tag) @_client.post("/projects/#{project_id}/tags", value: tag) end |
#list(project_id) ⇒ Hashie::Mash
List Tags for a single project
24 25 26 |
# File 'lib/projects/tags.rb', line 24 def list(project_id) @_client.get("/projects/#{project_id}/tags") end |
#remove(project_id, tag_id) ⇒ Hashie::Mash
Remove a tag from a project
40 41 42 |
# File 'lib/projects/tags.rb', line 40 def remove(project_id, tag_id) @_client.delete("/projects/#{project_id}/tags/#{tag_id}") end |