Module: Sunrise::Models::Comment::InstanceMethods

Defined in:
lib/sunrise/models/comment.rb

Instance Method Summary collapse

Instance Method Details

#anonymous?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/sunrise/models/comment.rb', line 36

def anonymous?
  author.nil?
end

#comments_countObject



28
29
30
# File 'lib/sunrise/models/comment.rb', line 28

def comments_count
  @comments_count ||= siblings.count
end

#siblingsObject



32
33
34
# File 'lib/sunrise/models/comment.rb', line 32

def siblings
  self.class.siblings_for(self)
end