module Teamlab::CommunityBlogs

Methods for working with community blogs

Public Instance Methods

add_comment(post_id, content, options = {}) click to toggle source
# File lib/teamlab/modules/community/community_blogs.rb, line 42
def add_comment(post_id, content, options = {})
  @request.post(['blog', post_id.to_s, 'comment'], { content: content }.merge(options))
end
create_post(title, content, options = {}) click to toggle source
# File lib/teamlab/modules/community/community_blogs.rb, line 38
def create_post(title, content, options = {})
  @request.post(%w[blog], { title: title, content: content }.merge(options))
end
delete_post(post_id) click to toggle source
# File lib/teamlab/modules/community/community_blogs.rb, line 50
def delete_post(post_id)
  @request.delete(['blog', post_id.to_s])
end
get_all_posts() click to toggle source
# File lib/teamlab/modules/community/community_blogs.rb, line 6
def get_all_posts
  @request.get(%w[blog])
end
get_blog_tags() click to toggle source
# File lib/teamlab/modules/community/community_blogs.rb, line 10
def get_blog_tags
  @request.get(%w[blog tag])
end
get_comments(post_id) click to toggle source
# File lib/teamlab/modules/community/community_blogs.rb, line 34
def get_comments(post_id)
  @request.get(['blog', post_id.to_s, 'comment'])
end
get_my_posts() click to toggle source
# File lib/teamlab/modules/community/community_blogs.rb, line 14
def get_my_posts
  @request.get(%w[blog @self])
end
get_post(post_id) click to toggle source
# File lib/teamlab/modules/community/community_blogs.rb, line 18
def get_post(post_id)
  @request.get(['blog', post_id.to_s])
end
get_posts_by_tag(tag) click to toggle source
# File lib/teamlab/modules/community/community_blogs.rb, line 22
def get_posts_by_tag(tag)
  @request.get(['blog', 'tag', tag.to_s])
end
get_user_posts(username) click to toggle source
# File lib/teamlab/modules/community/community_blogs.rb, line 30
def get_user_posts(username)
  @request.get(['blog', 'user', username.to_s])
end
search_posts(query) click to toggle source
# File lib/teamlab/modules/community/community_blogs.rb, line 26
def search_posts(query)
  @request.get(['blog', '@search', query.to_s])
end
update_post(post_id, title, content, options = {}) click to toggle source
# File lib/teamlab/modules/community/community_blogs.rb, line 46
def update_post(post_id, title, content, options = {})
  @request.put(['blog', post_id.to_s], { title: title, content: content }.merge(options))
end