Sha256: c3506cfc33c3f1e25339c96b397806da721263e137a4c15d44d783e7e81621cd
Contents?: true
Size: 860 Bytes
Versions: 17
Compression:
Stored size: 860 Bytes
Contents
module Totter class Client # Client methods for working with votes. module Votes # Create a vote. # # @param decision_user_id [Fixnum] the decision's owner's ID # @param decision_id [Fixnum] the decision's ID # @param choice_id [Fixnum] the choice's ID # @param options [Hash] specifiy `:unique_id` or `:invitation_slug` def create_vote(decision_user_id, decision_id, choice_id, options = {}) unique_id = options[: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 = options[:invitation_slug] params[:invitation] = { :slug => slug } if slug post(path, params).body end end end end
Version data entries
17 entries across 17 versions & 1 rubygems