Module: Teamlab::CommunityEvents
- Included in:
- Community
- Defined in:
- lib/teamlab/modules/community/community_events.rb
Overview
Methods for working with community events
Instance Method Summary collapse
- #add_comment_to_event(event_id, content, options = {}) ⇒ Object
- #create_event(title, content, options = {}) ⇒ Object
-
#delete_event(event_id) ⇒ Object
Deletes the selected event.
- #get_all_events ⇒ Object
- #get_event(id) ⇒ Object
- #get_event_comments(event_id) ⇒ Object
- #get_my_events ⇒ Object
- #search_events(query) ⇒ Object
- #update_event(event_id, options = {}) ⇒ Object
- #vote_for_event(event_id, *variants) ⇒ Object
Instance Method Details
#add_comment_to_event(event_id, content, options = {}) ⇒ Object
34 35 36 |
# File 'lib/teamlab/modules/community/community_events.rb', line 34 def add_comment_to_event(event_id, content, = {}) @request.post(['event', event_id.to_s, 'comment'], { content: content }.merge()) end |
#create_event(title, content, options = {}) ⇒ Object
26 27 28 |
# File 'lib/teamlab/modules/community/community_events.rb', line 26 def create_event(title, content, = {}) @request.post(%w[event], { title: title, content: content }.merge()) end |
#delete_event(event_id) ⇒ Object
Deletes the selected event
46 47 48 |
# File 'lib/teamlab/modules/community/community_events.rb', line 46 def delete_event(event_id) @request.delete(['event', event_id.to_s]) end |
#get_all_events ⇒ Object
6 7 8 |
# File 'lib/teamlab/modules/community/community_events.rb', line 6 def get_all_events @request.get(%w[event]) end |
#get_event(id) ⇒ Object
14 15 16 |
# File 'lib/teamlab/modules/community/community_events.rb', line 14 def get_event(id) @request.get(['event', id.to_s]) end |
#get_event_comments(event_id) ⇒ Object
22 23 24 |
# File 'lib/teamlab/modules/community/community_events.rb', line 22 def get_event_comments(event_id) @request.get(['event', event_id.to_s, 'comment']) end |
#get_my_events ⇒ Object
10 11 12 |
# File 'lib/teamlab/modules/community/community_events.rb', line 10 def get_my_events @request.get(%w[event @self]) end |
#search_events(query) ⇒ Object
18 19 20 |
# File 'lib/teamlab/modules/community/community_events.rb', line 18 def search_events(query) @request.get(['event', '@search', query]) end |
#update_event(event_id, options = {}) ⇒ Object
38 39 40 41 42 |
# File 'lib/teamlab/modules/community/community_events.rb', line 38 def update_event(event_id, = {}) @request.put(['event', event_id.to_s], title: [:title], content: [:content], type: [:type]) end |
#vote_for_event(event_id, *variants) ⇒ Object
30 31 32 |
# File 'lib/teamlab/modules/community/community_events.rb', line 30 def vote_for_event(event_id, *variants) @request.post(['event', event_id.to_s, 'vote'], variants: variants.flatten) end |