Module: Snooby::Voting

Included in:
Comment, Post
Defined in:
lib/snooby/actions.rb

Instance Method Summary collapse

Instance Method Details

#downvoteObject



69
70
71
# File 'lib/snooby/actions.rb', line 69

def downvote
  vote -1
end

#rescindObject



65
66
67
# File 'lib/snooby/actions.rb', line 65

def rescind
  vote 0
end

#upvoteObject



61
62
63
# File 'lib/snooby/actions.rb', line 61

def upvote
  vote 1
end

#vote(dir) ⇒ Object



57
58
59
# File 'lib/snooby/actions.rb', line 57

def vote(dir)
  Snooby.request Paths[:vote], :id => self.name, :dir => dir
end