Module: Teamlab::CommunityForums
- Included in:
- Community
- Defined in:
- lib/teamlab/modules/community/community_forums.rb
Overview
Methods for working with community forums
Instance Method Summary collapse
- #add_post_to_topic(topic_id, subject, content, options = {}) ⇒ Object
- #add_thread_to_category(category_id, category_name, thread_name, description) ⇒ Object
- #add_topic_to_thread(thread_id, subject, content, options = {}) ⇒ Object
-
#delete_category(category_id) ⇒ Teamlab::Response
Result of delete.
-
#delete_forum_post(post_id) ⇒ Teamlab::Response
Result of delete.
-
#delete_forum_topic(topic_id) ⇒ Teamlab::Response
Result of delete.
-
#delete_thread(thread_id) ⇒ Teamlab::Response
Result of delete.
- #get_forums ⇒ Object
- #get_last_updated_topics ⇒ Object
- #get_posts(topic_id) ⇒ Object
- #get_thread_topics(id) ⇒ Object
- #search_topics(query) ⇒ Object
- #update_post_in_topic(topic_id, post_id, options = {}) ⇒ Object
- #update_topic_in_thread(topic_id, subject, options = {}) ⇒ Object
Instance Method Details
#add_post_to_topic(topic_id, subject, content, options = {}) ⇒ Object
34 35 36 |
# File 'lib/teamlab/modules/community/community_forums.rb', line 34 def add_post_to_topic(topic_id, subject, content, = {}) @request.post(['forum', 'topic', topic_id.to_s], { subject: subject, content: content }.merge()) end |
#add_thread_to_category(category_id, category_name, thread_name, description) ⇒ Object
26 27 28 |
# File 'lib/teamlab/modules/community/community_forums.rb', line 26 def add_thread_to_category(category_id, category_name, thread_name, description) @request.post(%w[forum], categoryId: category_id, categoryName: category_name.to_s, threadName: thread_name, threadDescription: description) end |
#add_topic_to_thread(thread_id, subject, content, options = {}) ⇒ Object
30 31 32 |
# File 'lib/teamlab/modules/community/community_forums.rb', line 30 def add_topic_to_thread(thread_id, subject, content, = {}) @request.post(['forum', thread_id], { subject: subject, content: content }.merge()) end |
#delete_category(category_id) ⇒ Teamlab::Response
Returns result of delete.
66 67 68 |
# File 'lib/teamlab/modules/community/community_forums.rb', line 66 def delete_category(category_id) @request.delete(['forum', 'category', category_id.to_s]) end |
#delete_forum_post(post_id) ⇒ Teamlab::Response
Returns result of delete.
48 49 50 |
# File 'lib/teamlab/modules/community/community_forums.rb', line 48 def delete_forum_post(post_id) @request.delete(['forum', 'post', post_id.to_s]) end |
#delete_forum_topic(topic_id) ⇒ Teamlab::Response
Returns result of delete.
54 55 56 |
# File 'lib/teamlab/modules/community/community_forums.rb', line 54 def delete_forum_topic(topic_id) @request.delete(['forum', 'topic', topic_id.to_s]) end |
#delete_thread(thread_id) ⇒ Teamlab::Response
Returns result of delete.
60 61 62 |
# File 'lib/teamlab/modules/community/community_forums.rb', line 60 def delete_thread(thread_id) @request.delete(['forum', 'thread', thread_id.to_s]) end |
#get_forums ⇒ Object
6 7 8 |
# File 'lib/teamlab/modules/community/community_forums.rb', line 6 def get_forums @request.get(%w[forum]) end |
#get_last_updated_topics ⇒ Object
14 15 16 |
# File 'lib/teamlab/modules/community/community_forums.rb', line 14 def get_last_updated_topics @request.get(%w[forum topic recent]) end |
#get_posts(topic_id) ⇒ Object
18 19 20 |
# File 'lib/teamlab/modules/community/community_forums.rb', line 18 def get_posts(topic_id) @request.get(['forum', 'topic', topic_id.to_s]) end |
#get_thread_topics(id) ⇒ Object
10 11 12 |
# File 'lib/teamlab/modules/community/community_forums.rb', line 10 def get_thread_topics(id) @request.get(['forum', id.to_s]) end |
#search_topics(query) ⇒ Object
22 23 24 |
# File 'lib/teamlab/modules/community/community_forums.rb', line 22 def search_topics(query) @request.get(['forum', '@search', query.to_s]) end |
#update_post_in_topic(topic_id, post_id, options = {}) ⇒ Object
42 43 44 |
# File 'lib/teamlab/modules/community/community_forums.rb', line 42 def update_post_in_topic(topic_id, post_id, = {}) @request.put(['forum', 'topic', topic_id.to_s, post_id.to_s], ) end |
#update_topic_in_thread(topic_id, subject, options = {}) ⇒ Object
38 39 40 |
# File 'lib/teamlab/modules/community/community_forums.rb', line 38 def update_topic_in_thread(topic_id, subject, = {}) @request.put(['forum', 'topic', topic_id.to_s], { subject: subject }.merge()) end |