Class: MessagePresenter

Inherits:
BasePresenter show all
Defined in:
app/presenters/message_presenter.rb

Instance Attribute Summary

Attributes inherited from BasePresenter

#current_user

Instance Method Summary collapse

Methods inherited from BasePresenter

as_collection, #initialize, #method_missing, new

Constructor Details

This class inherits a constructor from BasePresenter

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class BasePresenter

Instance Method Details

#as_api_jsonObject


4
5
6
7
8
9
10
11
# File 'app/presenters/message_presenter.rb', line 4

def as_api_json
  {
    guid:       @presentable.guid,
    created_at: @presentable.created_at,
    body:       @presentable.text,
    author:     PersonPresenter.new(@presentable.author).as_api_json
  }
end