module Teamlab::CommunityWiki

Methods for working with community wikis

Public Instance Methods

create_page(name, body) click to toggle source
# File lib/teamlab/modules/community/community_wiki.rb, line 34
def create_page(name, body)
  @request.post(%w[wiki], name: name.to_s, body: body.to_s)
end
create_wiki_page_comment(page_name, content, options = {}) click to toggle source
# File lib/teamlab/modules/community/community_wiki.rb, line 42
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_wiki_file(name) click to toggle source
# File lib/teamlab/modules/community/community_wiki.rb, line 58
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/community_wiki.rb, line 54
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/community_wiki.rb, line 62
def delete_wiki_page_comment(id)
  @request.delete(['wiki', 'comment', id.to_s])
end
get_all_page_comments(page_name) click to toggle source
# File lib/teamlab/modules/community/community_wiki.rb, line 22
def get_all_page_comments(page_name)
  @request.get(['wiki', page_name.to_s, 'comment'])
end
get_page_history(name) click to toggle source
# File lib/teamlab/modules/community/community_wiki.rb, line 18
def get_page_history(name)
  @request.get(['wiki', name.to_s, 'story'])
end
get_wiki_file_info(name) click to toggle source
# File lib/teamlab/modules/community/community_wiki.rb, line 14
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/community_wiki.rb, line 10
def get_wiki_page(name, options = {})
  @request.get(['wiki', name], options)
end
get_wiki_pages() click to toggle source
# File lib/teamlab/modules/community/community_wiki.rb, line 6
def get_wiki_pages
  @request.get(%w[wiki])
end
search_wiki_pages_by_content(content) click to toggle source
# File lib/teamlab/modules/community/community_wiki.rb, line 30
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/community_wiki.rb, line 26
def search_wiki_pages_by_name(name)
  @request.get(['wiki', 'search', 'byname', name.to_s])
end
update_wiki_page(name, body) click to toggle source
# File lib/teamlab/modules/community/community_wiki.rb, line 46
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/community_wiki.rb, line 50
def update_wiki_page_comment(comment_id, body)
  @request.put(['wiki', 'comment', comment_id.to_s], content: body)
end
upload_files(file) click to toggle source
# File lib/teamlab/modules/community/community_wiki.rb, line 38
def upload_files(file)
  @request.post(%w[wiki file], somefile: File.new(file))
end