module Teamlab::CommunityEvents
Methods for working with community events
Public Instance Methods
add_comment_to_event(event_id, content, options = {})
click to toggle source
# File lib/teamlab/modules/community/community_events.rb, line 34 def add_comment_to_event(event_id, content, options = {}) @request.post(['event', event_id.to_s, 'comment'], { content: content }.merge(options)) end
create_event(title, content, options = {})
click to toggle source
# File lib/teamlab/modules/community/community_events.rb, line 26 def create_event(title, content, options = {}) @request.post(%w[event], { title: title, content: content }.merge(options)) end
delete_event(event_id)
click to toggle source
Deletes the selected event @param event_id [Integer] id of event
# 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()
click to toggle source
# File lib/teamlab/modules/community/community_events.rb, line 6 def get_all_events @request.get(%w[event]) end
get_event(id)
click to toggle source
# 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)
click to toggle source
# 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()
click to toggle source
# File lib/teamlab/modules/community/community_events.rb, line 10 def get_my_events @request.get(%w[event @self]) end
search_events(query)
click to toggle source
# 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 = {})
click to toggle source
# File lib/teamlab/modules/community/community_events.rb, line 38 def update_event(event_id, options = {}) @request.put(['event', event_id.to_s], title: options[:title], content: options[:content], type: options[:type]) end
vote_for_event(event_id, *variants)
click to toggle source
# 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