Module: Sunrise::Comments::Commentable::InstanceMethods

Defined in:
lib/sunrise/comments/commentable.rb

Instance Method Summary collapse

Instance Method Details

#anonymous?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/sunrise/comments/commentable.rb', line 36

def anonymous?
  author.nil?
end

#comments_countObject



28
29
30
# File 'lib/sunrise/comments/commentable.rb', line 28

def comments_count
  @comments_count ||= siblings.count
end

#siblingsObject



32
33
34
# File 'lib/sunrise/comments/commentable.rb', line 32

def siblings
  self.class.siblings_for(self)
end