+require 'action_controller/integration'
+
+class SelectricityService < ActionWebService::Base
+ web_service_api SelectricityAPI
+ def cast_quickvote(election_id, vote_id, vote_list)
+ #Obviously not implemented
+ end
+ def get_quickvote_results(shortname)
+ #TODO: Validate shortname
+ session=ActionController::Integration::Session.new
+ debugger
+ controller=session.get "quickvote/#{shortname}/results"
+ result=VoteResultStruct.new
+ result.plurality_winners=session.controller.plurality_result.winners.inspect
+ result.approval_winners=session.controller.approval_result.winners.inspect
+ result.condorcet_winners=session.controller.condorcet_result.winners.inspect
+ result.ssd_winners=session.controller.ssd_result.winners.inspect
+ result.borda_winners=session.controller.borda_result.winners.inspect
+ result
+ end
+end