Module: Feedlr::Gateway::Tags
- Included in:
- Client
- Defined in:
- lib/feedlr/gateway/tags.rb
Overview
Tags API
Instance Method Summary collapse
-
#change_tag_label(tag_id, new_value) ⇒ Feedlr::Success
Change a tag label.
-
#delete_tag(tag_id) ⇒ Feedlr::Success
Delete a tag.
-
#delete_tags(tags_ids) ⇒ Feedlr::Success
Delete tags.
-
#tag_entries(entries_ids, tags_ids) ⇒ Feedlr::Success
Tag multiple entries.
-
#tag_entry(entry_id, tags_ids) ⇒ Feedlr::Success
Tag an existing entry.
-
#untag_entries(entries_ids, tags_ids) ⇒ Feedlr::Success
Untag multiple entries.
-
#untag_entry(entry_id, tags_ids) ⇒ Feedlr::Success
Untag an existing entry.
-
#user_tags ⇒ Feedlr::Collection
Get the list of tags created by the user.
Instance Method Details
#change_tag_label(tag_id, new_value) ⇒ Feedlr::Success
Change a tag label
64 65 66 |
# File 'lib/feedlr/gateway/tags.rb', line 64 def change_tag_label(tag_id , new_value) build_object(:post , "/tags/#{CGI.escape(tag_id) }" , label: new_value) end |
#delete_tag(tag_id) ⇒ Feedlr::Success
Delete a tag
73 74 75 |
# File 'lib/feedlr/gateway/tags.rb', line 73 def delete_tag(tag_id) ([tag_id]) end |
#delete_tags(tags_ids) ⇒ Feedlr::Success
Delete tags
82 83 84 85 |
# File 'lib/feedlr/gateway/tags.rb', line 82 def () = .map { |t| CGI.escape(t) }.join(',') build_object(:delete , "/tags/#{ }") end |
#tag_entries(entries_ids, tags_ids) ⇒ Feedlr::Success
Tag multiple entries
31 32 33 34 |
# File 'lib/feedlr/gateway/tags.rb', line 31 def tag_entries(entries_ids , ) = .map { |t| CGI.escape(t) }.join(',') build_object(:put , "/tags/#{}" , entryIds: entries_ids) end |
#tag_entry(entry_id, tags_ids) ⇒ Feedlr::Success
Tag an existing entry
21 22 23 |
# File 'lib/feedlr/gateway/tags.rb', line 21 def tag_entry(entry_id , ) tag_entries([entry_id] , ) end |
#untag_entries(entries_ids, tags_ids) ⇒ Feedlr::Success
Untag multiple entries
52 53 54 55 56 |
# File 'lib/feedlr/gateway/tags.rb', line 52 def untag_entries(entries_ids , ) = .map { |t| CGI.escape(t) }.join(',') entries_query = entries_ids.map { |t| CGI.escape(t) }.join(',') build_object(:delete , "/tags/#{}/#{entries_query}") end |
#untag_entry(entry_id, tags_ids) ⇒ Feedlr::Success
Untag an existing entry
42 43 44 |
# File 'lib/feedlr/gateway/tags.rb', line 42 def untag_entry(entry_id , ) untag_entries([entry_id] , ) end |
#user_tags ⇒ Feedlr::Collection
Get the list of tags created by the user
11 12 13 |
# File 'lib/feedlr/gateway/tags.rb', line 11 def build_object(:get , '/tags') end |