diaspora/app/presenters/comment_presenter.rb
2017-02-13 21:47:57 +01:00

16 lines
468 B
Ruby

class CommentPresenter < BasePresenter
def initialize(comment)
@comment = comment
end
def as_json(opts={})
{
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)
}
end
end