Methods
D
U
V
Instance Public methods
downvotes()

Return the number of -1 comments (downvotes)

# File app/roles/votes.rb, line 16
def downvotes
  notes.select(&:downvote?).size
end
downvotes_in_percent()
# File app/roles/votes.rb, line 20
def downvotes_in_percent
  if votes_count.zero?
    0
  else
    100.0 - upvotes_in_percent
  end
end
upvotes()

Return the number of +1 comments (upvotes)

# File app/roles/votes.rb, line 3
def upvotes
  notes.select(&:upvote?).size
end
upvotes_in_percent()
# File app/roles/votes.rb, line 7
def upvotes_in_percent
  if votes_count.zero?
    0
  else
    100.0 / votes_count * upvotes
  end
end
votes_count()

Return the total number of votes

# File app/roles/votes.rb, line 29
def votes_count
  upvotes + downvotes
end