Method: Thredded::PostView#initialize

Defined in:
app/view_models/thredded/post_view.rb

#initialize(post, policy, topic_view: nil, first_in_page: false, first_unread_in_page: false) ⇒ PostView

Returns a new instance of PostView.

Parameters:

  • post (Thredded::PostCommon)
  • policy (#create? #update? #destroy? #moderate?)
  • topic_view (Thredded::TopicView) (defaults to: nil)
  • first_in_page (Boolean) (defaults to: false)
  • first_unread_in_page (Boolean) (defaults to: false)


22
23
24
25
26
27
28
# File 'app/view_models/thredded/post_view.rb', line 22

def initialize(post, policy, topic_view: nil, first_in_page: false, first_unread_in_page: false)
  @post   = post
  @policy = policy
  @topic_view = topic_view
  @first_unread_in_page = first_unread_in_page
  @first_in_page = first_in_page
end