comment_presenter.rb 468 Bytes
Newer Older
Dennis Collinson's avatar
Dennis Collinson committed
1 2 3 4 5 6 7
class CommentPresenter < BasePresenter
  def initialize(comment)
    @comment = comment
  end

  def as_json(opts={})
    {
8 9 10 11 12 13
      id:               @comment.id,
      guid:             @comment.guid,
      text:             @comment.message.plain_text_for_json,
      author:           @comment.author.as_api_response(:backbone),
      created_at:       @comment.created_at,
      mentioned_people: @comment.mentioned_people.as_api_response(:backbone)
Dennis Collinson's avatar
Dennis Collinson committed
14 15
    }
  end
16
end