class Teamlab::Community
Public Class Methods
new()
click to toggle source
# File lib/teamlab/modules/community.rb, line 3 def initialize @request = Teamlab::Request.new('community') end
Public Instance Methods
add_bookmark(url, title, options = {})
click to toggle source
# File lib/teamlab/modules/community.rb, line 95 def add_bookmark(url, title, options = {}) @request.post(%w(bookmark), { url: url, title: title }.merge(options)) end
add_comment(post_id, content, options = {})
click to toggle source
# File lib/teamlab/modules/community.rb, line 43 def add_comment(post_id, content, options = {}) @request.post(['blog', post_id.to_s, 'comment'], { content: content }.merge(options)) end
add_comment_to_bookmark(bookmark_id, content, options = {})
click to toggle source
# File lib/teamlab/modules/community.rb, line 99 def add_comment_to_bookmark(bookmark_id, content, options = {}) @request.post(['bookmark', bookmark_id.to_s, 'comment'], { content: content }.merge(options)) end
add_comment_to_event(event_id, content, options = {})
click to toggle source
# File lib/teamlab/modules/community.rb, line 131 def add_comment_to_event(event_id, content, options = {}) @request.post(['event', event_id.to_s, 'comment'], { content: content }.merge(options)) end
add_post_to_topic(topic_id, subject, content, options = {})
click to toggle source
# File lib/teamlab/modules/community.rb, line 169 def add_post_to_topic(topic_id, subject, content, options = {}) @request.post(['forum', 'topic', topic_id.to_s], { subject: subject, content: content }.merge(options)) end
add_thread_to_category(category_id, category_name, thread_name, description)
click to toggle source
add_topic_to_thread(thread_id, subject, content, options = {})
click to toggle source
# File lib/teamlab/modules/community.rb, line 165 def add_topic_to_thread(thread_id, subject, content, options = {}) @request.post(['forum', thread_id], { subject: subject, content: content }.merge(options)) end
create_event(title, content, options = {})
click to toggle source
# File lib/teamlab/modules/community.rb, line 123 def create_event(title, content, options = {}) @request.post(%w(event), { title: title, content: content }.merge(options)) end
create_page(name, body)
click to toggle source
# File lib/teamlab/modules/community.rb, line 213 def create_page(name, body) @request.post(%w(wiki), name: name.to_s, body: body.to_s) end
create_post(title, content, options = {})
click to toggle source
# File lib/teamlab/modules/community.rb, line 39 def create_post(title, content, options = {}) @request.post(%w(blog), { title: title, content: content }.merge(options)) end
create_wiki_page_comment(page_name, content, options = {})
click to toggle source
# File lib/teamlab/modules/community.rb, line 221 def create_wiki_page_comment(page_name, content, options = {}) @request.post(['wiki', page_name.to_s, 'comment'], { content: content.to_s }.merge(options)) end
delete_post(post_id)
click to toggle source
# File lib/teamlab/modules/community.rb, line 51 def delete_post(post_id) @request.delete(['blog', post_id.to_s]) end
delete_post_in_topic(topic_id, post_id)
click to toggle source
# File lib/teamlab/modules/community.rb, line 181 def delete_post_in_topic(topic_id, post_id) @request.delete(['forum', 'topic', topic_id.to_s, post_id.to_s]) end
delete_wiki_file(name)
click to toggle source
# File lib/teamlab/modules/community.rb, line 237 def delete_wiki_file(name) @request.delete(['wiki', 'file', name.to_s]) end
delete_wiki_page(name)
click to toggle source
# File lib/teamlab/modules/community.rb, line 233 def delete_wiki_page(name) @request.delete(['wiki', name.to_s]) end
delete_wiki_page_comment(id)
click to toggle source
# File lib/teamlab/modules/community.rb, line 241 def delete_wiki_page_comment(id) @request.delete(['wiki', 'comment', id.to_s]) end
get_all_bookmarks()
click to toggle source
# File lib/teamlab/modules/community.rb, line 55 def get_all_bookmarks @request.get(%w(bookmark)) end
get_all_events()
click to toggle source
# File lib/teamlab/modules/community.rb, line 103 def get_all_events @request.get(%w(event)) end
get_all_page_comments(page_name)
click to toggle source
# File lib/teamlab/modules/community.rb, line 201 def get_all_page_comments(page_name) @request.get(['wiki', page_name.to_s, 'comment']) end
get_all_posts()
click to toggle source
# File lib/teamlab/modules/community.rb, line 7 def get_all_posts @request.get(%w(blog)) end
get_bookmark(id)
click to toggle source
# File lib/teamlab/modules/community.rb, line 63 def get_bookmark(id) @request.get(['bookmark', id.to_s]) end
get_bookmark_comments(bookmark_id)
click to toggle source
# File lib/teamlab/modules/community.rb, line 87 def get_bookmark_comments(bookmark_id) @request.get(['bookmark', bookmark_id.to_s, 'comment']) end
get_bookmarks_added_by_me()
click to toggle source
# File lib/teamlab/modules/community.rb, line 67 def get_bookmarks_added_by_me @request.get(%w(bookmark @self)) end
get_bookmarks_by_tag(tag)
click to toggle source
# File lib/teamlab/modules/community.rb, line 79 def get_bookmarks_by_tag(tag) @request.get(['bookmark', 'tag', tag.to_s]) end
get_comments(post_id)
click to toggle source
# File lib/teamlab/modules/community.rb, line 35 def get_comments(post_id) @request.get(['blog', post_id.to_s, 'comment']) end
get_event(id)
click to toggle source
# File lib/teamlab/modules/community.rb, line 111 def get_event(id) @request.get(['event', id.to_s]) end
get_event_comments(event_id)
click to toggle source
# File lib/teamlab/modules/community.rb, line 119 def get_event_comments(event_id) @request.get(['event', event_id.to_s, 'comment']) end
get_forums()
click to toggle source
# File lib/teamlab/modules/community.rb, line 139 def get_forums @request.get(%w(forum)) end
get_last_updated_topics()
click to toggle source
# File lib/teamlab/modules/community.rb, line 147 def get_last_updated_topics @request.get(%w(forum topic recent)) end
get_my_events()
click to toggle source
# File lib/teamlab/modules/community.rb, line 107 def get_my_events @request.get(%w(event @self)) end
get_my_favourite_bookmarks()
click to toggle source
# File lib/teamlab/modules/community.rb, line 71 def get_my_favourite_bookmarks @request.get(%w(bookmark @favs)) end
get_my_posts()
click to toggle source
# File lib/teamlab/modules/community.rb, line 15 def get_my_posts @request.get(%w(blog @self)) end
get_page_history(name)
click to toggle source
# File lib/teamlab/modules/community.rb, line 197 def get_page_history(name) @request.get(['wiki', name.to_s, 'story']) end
get_post(post_id)
click to toggle source
# File lib/teamlab/modules/community.rb, line 19 def get_post(post_id) @request.get(['blog', post_id.to_s]) end
get_posts(topic_id)
click to toggle source
# File lib/teamlab/modules/community.rb, line 151 def get_posts(topic_id) @request.get(['forum', 'topic', topic_id.to_s]) end
get_posts_by_tag(tag)
click to toggle source
# File lib/teamlab/modules/community.rb, line 23 def get_posts_by_tag(tag) @request.get(['blog', 'tag', tag.to_s]) end
get_recently_added_bookmarks()
click to toggle source
# File lib/teamlab/modules/community.rb, line 83 def get_recently_added_bookmarks @request.get(%w(bookmark top recent)) end
get_thread_topics(id)
click to toggle source
# File lib/teamlab/modules/community.rb, line 143 def get_thread_topics(id) @request.get(['forum', id.to_s]) end
get_user_posts(username)
click to toggle source
# File lib/teamlab/modules/community.rb, line 31 def get_user_posts(username) @request.get(['blog', 'user', username.to_s]) end
get_wiki_file_info(name)
click to toggle source
# File lib/teamlab/modules/community.rb, line 193 def get_wiki_file_info(name) @request.get(['wiki', 'file', name.to_s]) end
get_wiki_page(name, options = {})
click to toggle source
# File lib/teamlab/modules/community.rb, line 189 def get_wiki_page(name, options = {}) @request.get(['wiki', name], options) end
get_wiki_pages()
click to toggle source
# File lib/teamlab/modules/community.rb, line 185 def get_wiki_pages @request.get(%w(wiki)) end
search_bookmarks(queue)
click to toggle source
# File lib/teamlab/modules/community.rb, line 91 def search_bookmarks(queue) @request.get(['bookmark', '@search', queue.to_s]) end
search_events(query)
click to toggle source
# File lib/teamlab/modules/community.rb, line 115 def search_events(query) @request.get(['event', '@search', query]) end
search_posts(query)
click to toggle source
# File lib/teamlab/modules/community.rb, line 27 def search_posts(query) @request.get(['blog', '@search', query.to_s]) end
search_topics(query)
click to toggle source
# File lib/teamlab/modules/community.rb, line 155 def search_topics(query) @request.get(['forum', '@search', query.to_s]) end
search_wiki_pages_by_content(content)
click to toggle source
# File lib/teamlab/modules/community.rb, line 209 def search_wiki_pages_by_content(content) @request.get(['wiki', 'search', 'bycontent', content.to_s]) end
search_wiki_pages_by_name(name)
click to toggle source
# File lib/teamlab/modules/community.rb, line 205 def search_wiki_pages_by_name(name) @request.get(['wiki', 'search', 'byname', name.to_s]) end
update_event(event_id, title, content, options = {})
click to toggle source
# File lib/teamlab/modules/community.rb, line 135 def update_event(event_id, title, content, options = {}) @request.put(['event', event_id.to_s], { title: title, content: content }.merge(options)) end
update_post(post_id, title, content, options = {})
click to toggle source
# File lib/teamlab/modules/community.rb, line 47 def update_post(post_id, title, content, options = {}) @request.put(['blog', post_id.to_s], { title: title, content: content }.merge(options)) end
update_post_in_topic(topic_id, post_id, options = {})
click to toggle source
# File lib/teamlab/modules/community.rb, line 177 def update_post_in_topic(topic_id, post_id, options = {}) @request.put(['forum', 'topic', topic_id.to_s, post_id.to_s], options) end
update_topic_in_thread(topic_id, subject, options = {})
click to toggle source
# File lib/teamlab/modules/community.rb, line 173 def update_topic_in_thread(topic_id, subject, options = {}) @request.put(['forum', 'topic', topic_id.to_s], { subject: subject }.merge(options)) end
update_wiki_page(name, body)
click to toggle source
# File lib/teamlab/modules/community.rb, line 225 def update_wiki_page(name, body) @request.put(['wiki', name.to_s], body: body.to_s) end
update_wiki_page_comment(comment_id, body)
click to toggle source
# File lib/teamlab/modules/community.rb, line 229 def update_wiki_page_comment(comment_id, body) @request.put(['wiki', 'comment', comment_id.to_s], body: body) end
upload_files(file)
click to toggle source
# File lib/teamlab/modules/community.rb, line 217 def upload_files(file) @request.post(%w(wiki file), somefile: File.new(file)) end
vote_for_event(event_id, *variants)
click to toggle source
# File lib/teamlab/modules/community.rb, line 127 def vote_for_event(event_id, *variants) @request.post(['event', event_id.to_s, 'vote'], variants: variants.flatten) end