Module: Totter::Client::Votes
- Included in:
- Totter::Client
- Defined in:
- lib/totter/client/votes.rb
Overview
Client methods for working with votes.
Instance Method Summary collapse
Instance Method Details
#create_vote(decision_user_id, decision_id, choice_id, options = {}) ⇒ Object
Create a vote.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/totter/client/votes.rb', line 11 def create_vote(decision_user_id, decision_id, choice_id, = {}) unique_id = [:unique_id] raise UniqueIDRequired unless unique_id or self.authenticated? path = "users/#{decision_user_id}/decisions/#{decision_id}/votes" params = { :choice_id => choice_id, :unique_id => unique_id } slug = [:invitation_slug] params[:invitation] = { :slug => slug } if slug post(path, params).body end |