Module: Teamlab::CommunityBookmarks

Included in:
Community
Defined in:
lib/teamlab/modules/community/community_bookmarks.rb

Overview

Methods for working with community bookmarks

Instance Method Summary collapse

Instance Method Details

#add_bookmark(url, title, options = {}) ⇒ Object



46
47
48
# File 'lib/teamlab/modules/community/community_bookmarks.rb', line 46

def add_bookmark(url, title, options = {})
  @request.post(%w[bookmark], { url: url, title: title }.merge(options))
end

#add_comment_to_bookmark(bookmark_id, content, options = {}) ⇒ Object



50
51
52
# File 'lib/teamlab/modules/community/community_bookmarks.rb', line 50

def add_comment_to_bookmark(bookmark_id, content, options = {})
  @request.post(['bookmark', bookmark_id.to_s, 'comment'], { content: content }.merge(options))
end

#delete_bookmark(bookmark_id) ⇒ Teamlab::Response

Returns result of delete.

Parameters:

  • bookmark_id (Intger)

    bookmark to delete

Returns:



56
57
58
# File 'lib/teamlab/modules/community/community_bookmarks.rb', line 56

def delete_bookmark(bookmark_id)
  @request.delete(['bookmark', bookmark_id.to_s])
end

#get_all_bookmark_tagsObject



10
11
12
# File 'lib/teamlab/modules/community/community_bookmarks.rb', line 10

def get_all_bookmark_tags
  @request.get(%w[bookmark tag])
end

#get_all_bookmarksObject



6
7
8
# File 'lib/teamlab/modules/community/community_bookmarks.rb', line 6

def get_all_bookmarks
  @request.get(%w[bookmark])
end

#get_bookmark(id) ⇒ Object



14
15
16
# File 'lib/teamlab/modules/community/community_bookmarks.rb', line 14

def get_bookmark(id)
  @request.get(['bookmark', id.to_s])
end

#get_bookmark_comments(bookmark_id) ⇒ Object



38
39
40
# File 'lib/teamlab/modules/community/community_bookmarks.rb', line 38

def get_bookmark_comments(bookmark_id)
  @request.get(['bookmark', bookmark_id.to_s, 'comment'])
end

#get_bookmarks_added_by_meObject



18
19
20
# File 'lib/teamlab/modules/community/community_bookmarks.rb', line 18

def get_bookmarks_added_by_me
  @request.get(%w[bookmark @self])
end

#get_bookmarks_by_tag(tag) ⇒ Object



30
31
32
# File 'lib/teamlab/modules/community/community_bookmarks.rb', line 30

def get_bookmarks_by_tag(tag)
  @request.get(['bookmark', "bytag?tag=#{tag.to_s.gsub(' ', '%20')}"])
end

#get_my_favourite_bookmarksObject



22
23
24
# File 'lib/teamlab/modules/community/community_bookmarks.rb', line 22

def get_my_favourite_bookmarks
  @request.get(%w[bookmark @favs])
end

#get_recently_added_bookmarksObject



34
35
36
# File 'lib/teamlab/modules/community/community_bookmarks.rb', line 34

def get_recently_added_bookmarks
  @request.get(%w[bookmark top recent])
end

#search_bookmarks(queue) ⇒ Object



42
43
44
# File 'lib/teamlab/modules/community/community_bookmarks.rb', line 42

def search_bookmarks(queue)
  @request.get(['bookmark', '@search', queue.to_s])
end