Class: CamaleonCms::PostCommentDecorator

Inherits:
Draper::Decorator
  • Object
show all
Defined in:
app/decorators/camaleon_cms/post_comment_decorator.rb

Instance Method Summary collapse

Instance Method Details

#the_answersObject



24
25
26
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 24

def the_answers
  object.children.approveds
end

#the_author_emailObject



32
33
34
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 32

def the_author_email
  object.author_email.presence || object.user.email
end

#the_author_nameObject



28
29
30
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 28

def the_author_name
  object.author.presence || object.user.full_name
end

#the_author_urlObject



36
37
38
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 36

def the_author_url
  object.author_url.presence || (object.user.username == 'anonymous' ? '' : object.user.decorate.the_url)
end

#the_contentObject



20
21
22
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 20

def the_content
  object.content
end

#the_created_at(format = :long) ⇒ Object

return created at date formatted



6
7
8
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 6

def the_created_at(format = :long)
  h.l(object.created_at, format: format.to_sym)
end

#the_postObject



16
17
18
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 16

def the_post
  object.post.decorate
end

#the_userObject Also known as: the_author

return owner of this comment



11
12
13
# File 'app/decorators/camaleon_cms/post_comment_decorator.rb', line 11

def the_user
  object.user.decorate
end