Class: VoteFu::Vote
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- VoteFu::Vote
- Defined in:
- app/models/vote_fu/vote.rb
Instance Method Summary collapse
- #direction ⇒ Object
- #down? ⇒ Boolean
-
#up? ⇒ Boolean
Instance methods.
Instance Method Details
#direction ⇒ Object
45 46 47 48 49 50 |
# File 'app/models/vote_fu/vote.rb', line 45 def direction return :up if up? return :down if down? :neutral end |
#down? ⇒ Boolean
41 42 43 |
# File 'app/models/vote_fu/vote.rb', line 41 def down? value.negative? end |
#up? ⇒ Boolean
Instance methods
37 38 39 |
# File 'app/models/vote_fu/vote.rb', line 37 def up? value.positive? end |