Module: Tags
- Included in:
- Config
- Defined in:
- lib/user/config/tags.rb
Instance Method Summary collapse
-
#create_tag(data) ⇒ Object
Create tag.
-
#get_tag(id) ⇒ Object
Get tag.
-
#get_tags ⇒ Object
Get tags.
-
#update_tag(id, data) ⇒ Object
Update tag.
Instance Method Details
#create_tag(data) ⇒ Object
Create tag.
Create a tag with data.
Parameters
- data
-
(Hash) – Data to be submitted.
Example
data = {
"tag": "new-tag",
"is_visible": true
}
@data = @mints_user.create_tag(data.to_json)
39 40 41 |
# File 'lib/user/config/tags.rb', line 39 def create_tag(data) return @client.raw("post", "/config/tags", nil, data) end |
#get_tag(id) ⇒ Object
Get tag.
Get a tag info.
Parameters
- id
-
(Integer) – Tag id.
Example
@data = @mints_user.get_tag(1)
23 24 25 |
# File 'lib/user/config/tags.rb', line 23 def get_tag(id) return @client.raw("get", "/config/tags/#{id}") end |
#get_tags ⇒ Object
Get tags.
Get a collection of tags.
Example
@data = @mints_user.
11 12 13 |
# File 'lib/user/config/tags.rb', line 11 def return @client.raw("get", "/config/tags") end |
#update_tag(id, data) ⇒ Object
Update tag.
Update a tag info.
Parameters
- id
-
(Integer) – Tag id.
- data
-
(Hash) – Data to be submitted.
Example
data = {
"tag": {
"tag": "new-tag",
"slug": "new-tag",
"is_visible": false
}
}
@data = @mints_user.update_tag(54, data.to_json)
59 60 61 62 |
# File 'lib/user/config/tags.rb', line 59 def update_tag(id, data) #TODO: Inform TagController.update method has been modified return @client.raw("put", "/config/tags/#{id}", nil, data) end |