Class: CommentPresenter

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

Instance Method Summary collapse

Methods inherited from BasePresenter

#initialize

Methods included from DmCore::LiquidHelper

#liquidize_html, #liquidize_markdown, #liquidize_textile, #markdown, #sanitize_text

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

#authorObject




16
17
18
# File 'app/presenters/comment_presenter.rb', line 16

def author
  comment.user.nil? ? 'Anonymous' : comment.user.display_name
end

#date_postedObject




11
12
13
# File 'app/presenters/comment_presenter.rb', line 11

def date_posted
  format_datetime comment.created_at
end

#formatted_commentObject




6
7
8
# File 'app/presenters/comment_presenter.rb', line 6

def formatted_comment
    markdown(comment.body, :safe => true)
end