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
- #add_bookmark(url, title, options = {}) ⇒ Object
- #add_comment_to_bookmark(bookmark_id, content, options = {}) ⇒ Object
-
#delete_bookmark(bookmark_id) ⇒ Teamlab::Response
Result of delete.
- #get_all_bookmark_tags ⇒ Object
- #get_all_bookmarks ⇒ Object
- #get_bookmark(id) ⇒ Object
- #get_bookmark_comments(bookmark_id) ⇒ Object
- #get_bookmarks_added_by_me ⇒ Object
- #get_bookmarks_by_tag(tag) ⇒ Object
- #get_my_favourite_bookmarks ⇒ Object
- #get_recently_added_bookmarks ⇒ Object
- #search_bookmarks(queue) ⇒ Object
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, = {}) @request.post(%w[bookmark], { url: url, title: title }.merge()) 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, = {}) @request.post(['bookmark', bookmark_id.to_s, 'comment'], { content: content }.merge()) end |
#delete_bookmark(bookmark_id) ⇒ Teamlab::Response
Returns result of delete.
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_tags ⇒ Object
10 11 12 |
# File 'lib/teamlab/modules/community/community_bookmarks.rb', line 10 def @request.get(%w[bookmark tag]) end |
#get_all_bookmarks ⇒ Object
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_me ⇒ Object
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_bookmarks ⇒ Object
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_bookmarks ⇒ Object
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 |