Module: Feedlr::Gateway::Tags

Included in:
Client
Defined in:
lib/feedlr/gateway/tags.rb

Overview

Tags API

Instance Method Summary collapse

Instance Method Details

#change_tag_label(tag_id, new_value) ⇒ Feedlr::Success

Change a tag label

Parameters:

  • tag_id (String)
  • new_value (String)

    label's new value

Returns:

See Also:



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

Parameters:

  • tag_id (String)

Returns:

See Also:



73
74
75
# File 'lib/feedlr/gateway/tags.rb', line 73

def delete_tag(tag_id)
  delete_tags([tag_id])
end

#delete_tags(tags_ids) ⇒ Feedlr::Success

Delete tags

Parameters:

  • tags_ids (Array)

    list of ids

Returns:

See Also:



82
83
84
85
# File 'lib/feedlr/gateway/tags.rb', line 82

def delete_tags(tags_ids)
  tags_query = tags_ids.map { |t| CGI.escape(t) }.join(',')
  build_object(:delete , "/tags/#{tags_query }")
end

#tag_entries(entries_ids, tags_ids) ⇒ Feedlr::Success

Tag multiple entries

Parameters:

  • entries_ids (Array)

    list of entries ids

  • tags_ids (Array)

    list of tags ids

Returns:

See Also:



31
32
33
34
# File 'lib/feedlr/gateway/tags.rb', line 31

def tag_entries(entries_ids , tags_ids)
  tags_query = tags_ids.map { |t| CGI.escape(t) }.join(',')
  build_object(:put , "/tags/#{tags_query}" , entryIds: entries_ids)
end

#tag_entry(entry_id, tags_ids) ⇒ Feedlr::Success

Tag an existing entry

Parameters:

  • entry_id (String)
  • tags_ids (Array)

    list of tags ids

Returns:

See Also:



21
22
23
# File 'lib/feedlr/gateway/tags.rb', line 21

def tag_entry(entry_id , tags_ids)
  tag_entries([entry_id] , tags_ids)
end

#untag_entries(entries_ids, tags_ids) ⇒ Feedlr::Success

Untag multiple entries

Parameters:

  • entries_ids (Array)

    list of entries ids

  • tags_ids (Array)

    list of tags ids

Returns:

See Also:



52
53
54
55
56
# File 'lib/feedlr/gateway/tags.rb', line 52

def untag_entries(entries_ids , tags_ids)
  tags_query = tags_ids.map { |t| CGI.escape(t) }.join(',')
  entries_query = entries_ids.map { |t| CGI.escape(t) }.join(',')
  build_object(:delete , "/tags/#{tags_query}/#{entries_query}")
end

#untag_entry(entry_id, tags_ids) ⇒ Feedlr::Success

Untag an existing entry

Parameters:

  • entry_id (String)
  • tags_ids (Array)

    list of tags ids

Returns:

See Also:



42
43
44
# File 'lib/feedlr/gateway/tags.rb', line 42

def untag_entry(entry_id , tags_ids)
  untag_entries([entry_id] , tags_ids)
end

#user_tagsFeedlr::Collection

Get the list of tags created by the user



11
12
13
# File 'lib/feedlr/gateway/tags.rb', line 11

def user_tags
  build_object(:get , '/tags')
end