Module: VoteGem
- Defined in:
- lib/vote_gem.rb,
lib/vote_gem/version.rb
Constant Summary collapse
- VERSION =
"0.0.1"
Instance Method Summary collapse
- #down_votes ⇒ Object
- #total_votes ⇒ Object
-
#up_votes ⇒ Object
Your code goes here…
Instance Method Details
#down_votes ⇒ Object
9 10 11 |
# File 'lib/vote_gem.rb', line 9 def down_votes self.votes.where(vote: false).length end |
#total_votes ⇒ Object
13 14 15 |
# File 'lib/vote_gem.rb', line 13 def total_votes up_votes - down_votes end |
#up_votes ⇒ Object
Your code goes here…
5 6 7 |
# File 'lib/vote_gem.rb', line 5 def up_votes self.votes.where(vote: true).length end |