+
+ def build_ranked_candidates
+ # build a lis of ranked candidates by dropping the winner and
+ # cursing
+
+ ranked_candidates = []
+
+ resultobj = self.dup
+ candidates = self.election.candidates
+
+ until candidates.empty?
+ ranked_candidates << resultobj.winners
+
+ new_voteobj = resultobj.election.dup
+ candidates = new_voteobj.candidates
+ new_voteobj.candidates.delete_if {|x| resultobj.winners.include?(x)}
+ resultobj = new_voteobj.result
+ end
+
+ ranked_candidates
+ end