class Zendesk2::HelpCenter::Post

Public Instance Methods

author() click to toggle source
# File lib/zendesk2/help_center/post.rb, line 63
def author
  cistern.users.get!(author_id) if author_id
end
destroy!() click to toggle source
# File lib/zendesk2/help_center/post.rb, line 43
def destroy!
  requires :identity

  cistern.destroy_help_center_post('post' => { 'id' => identity })
end
save!() click to toggle source
# File lib/zendesk2/help_center/post.rb, line 49
def save!
  response = if new_record?
               requires :title, :details, :topic_id

               cistern.create_help_center_post('post' => attributes)
             else
               requires :identity

               cistern.update_help_center_post('post' => attributes)
             end

  merge_attributes(response.body['post'])
end
subscriptions() click to toggle source
# File lib/zendesk2/help_center/post.rb, line 73
def subscriptions
  requires :identity

  cistern.help_center_subscriptions(content_id: identity, content_type: 'post')
end
topic() click to toggle source
# File lib/zendesk2/help_center/post.rb, line 67
def topic
  requires :topic_id

  cistern.help_center_topics.get!(topic_id)
end