Module: SuperVotes
- Defined in:
- lib/super_votes.rb,
lib/super_votes/version.rb
Constant Summary collapse
- VERSION =
"0.0.1"
Instance Method Summary collapse
Instance Method Details
#down_votes ⇒ Object
8 9 10 |
# File 'lib/super_votes.rb', line 8 def down_votes self.votes.where(vote: false).length end |
#total_votes ⇒ Object
12 13 14 |
# File 'lib/super_votes.rb', line 12 def total_votes up_votes - down_votes end |
#up_votes ⇒ Object
4 5 6 |
# File 'lib/super_votes.rb', line 4 def up_votes self.votes.where(vote: true).length end |