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
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 = @cxf_user.create_tag(data)
40 41 42 |
# File 'lib/user/config/tags.rb', line 40 def create_tag(data) @client.raw('post', '/config/tags', nil, data_transform(data)) end |
#get_tag(id) ⇒ Object
Get tag.
Get a tag info.
Parameters
- id
-
(Integer) – Tag id.
Example
@data = @cxf_user.get_tag(1)
24 25 26 |
# File 'lib/user/config/tags.rb', line 24 def get_tag(id) @client.raw('get', "/config/tags/#{id}") end |
#get_tags ⇒ Object
Tags
Get tags.
Get a collection of tags.
Example
@data = @cxf_user.
12 13 14 |
# File 'lib/user/config/tags.rb', line 12 def @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: 'new-tag',
slug: 'new-tag',
is_visible: false
}
@data = @cxf_user.update_tag(54, data)
58 59 60 |
# File 'lib/user/config/tags.rb', line 58 def update_tag(id, data) @client.raw('put', "/config/tags/#{id}", nil, data_transform(data)) end |