Class: VoteFu::Vote

Inherits:
ApplicationRecord show all
Defined in:
app/models/vote_fu/vote.rb

Instance Method Summary collapse

Instance Method Details

#directionObject



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

Returns:

  • (Boolean)


41
42
43
# File 'app/models/vote_fu/vote.rb', line 41

def down?
  value.negative?
end

#up?Boolean

Instance methods

Returns:

  • (Boolean)


37
38
39
# File 'app/models/vote_fu/vote.rb', line 37

def up?
  value.positive?
end