diaspora/app/presenters/comment_presenter.rb
2014-11-09 07:47:40 -08:00

15 lines
352 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
}
end
end