1 require 'action_controller/integration'
3 class SelectricityService < ActionWebService::Base
4 web_service_api SelectricityAPI
5 def cast_quickvote(election_id, vote_id, vote_list)
6 #Obviously not implemented
8 def get_quickvote_results(shortname)
9 #TODO: Validate shortname
10 session=ActionController::Integration::Session.new
12 controller=session.get "quickvote/#{shortname}/results"
13 result=VoteResultStruct.new
14 result.plurality_winners=session.controller.plurality_result.winners.inspect
15 result.approval_winners=session.controller.approval_result.winners.inspect
16 result.condorcet_winners=session.controller.condorcet_result.winners.inspect
17 result.ssd_winners=session.controller.ssd_result.winners.inspect
18 result.borda_winners=session.controller.borda_result.winners.inspect