Class: Tenk::Tags
- Inherits:
-
Object
- Object
- Tenk::Tags
- Defined in:
- lib/users/tags.rb
Overview
API methods for listing, adding, and removing tags for users
Instance Method Summary collapse
-
#add(user_id, tag) ⇒ Hashie::Mash
Attach a tag to a user.
-
#initialize(client) ⇒ Tags
constructor
Initialize a Tenk::Users::Tag resource API wrapper for the given client.
-
#list(user_id) ⇒ Hashie::Mash
List Tags for a single user.
-
#remove(user_id, tag_id) ⇒ Hashie::Mash
Remove a tag from a user.
Constructor Details
#initialize(client) ⇒ Tags
Initialize a Tenk::Users::Tag resource API wrapper for the given client
5 6 7 |
# File 'lib/users/tags.rb', line 5 def initialize(client) @_client = client end |
Instance Method Details
#add(user_id, tag) ⇒ Hashie::Mash
Attach a tag to a user
21 22 23 |
# File 'lib/users/tags.rb', line 21 def add(user_id, tag) @_client.post("/users/#{user_id}/tags", value: tag) end |
#list(user_id) ⇒ Hashie::Mash
List Tags for a single user
13 14 15 |
# File 'lib/users/tags.rb', line 13 def list(user_id) @_client.get("/users/#{user_id}/tags") end |
#remove(user_id, tag_id) ⇒ Hashie::Mash
Remove a tag from a user
29 30 31 |
# File 'lib/users/tags.rb', line 29 def remove(user_id, tag_id) @_client.delete("/users/#{user_id}/tags/#{tag_id}") end |