Class: ExtremePostPresenter

Inherits:
Object
  • Object
show all
Defined in:
app/presenters/extreme_post_presenter.rb

Overview

this file should go away, hence the name that is so full of lulz post interactions should probably be a decorator, and used in very few places… maybe?

Instance Method Summary collapse

Constructor Details

#initialize(post, current_user) ⇒ ExtremePostPresenter


4
5
6
7
# File 'app/presenters/extreme_post_presenter.rb', line 4

def initialize(post, current_user)
  @post = post
  @current_user = current_user
end

Instance Method Details

#as_json(options = {}) ⇒ Object


9
10
11
12
13
# File 'app/presenters/extreme_post_presenter.rb', line 9

def as_json(options={})
  post = PostPresenter.new(@post, @current_user)
  interactions = PostInteractionPresenter.new(@post, @current_user)
  post.as_json.merge!(:interactions => interactions.as_json)
end