X-Git-Url: https://projects.mako.cc/source/rubyvote/blobdiff_plain/1da0a60f448820070d47333a7316364e009f203e..f4daa2d9ecfe54c85e0917abddfe57dfe5fc54e6:/lib/rubyvote/condorcet.rb diff --git a/lib/rubyvote/condorcet.rb b/lib/rubyvote/condorcet.rb index b3bdcd6..5f103fb 100644 --- a/lib/rubyvote/condorcet.rb +++ b/lib/rubyvote/condorcet.rb @@ -62,23 +62,33 @@ class CondorcetVote < ElectionVote end end + def result + top_result = resultFactory( self ) + until @candidates.empty? + aResult = resultFactory( self ) + top_result.full_results << aResult + filter_out(aResult) + end + top_result + end + protected def verify_vote(vote=nil) vote.instance_of?( Array ) and vote == vote.uniq end - + end class PureCondorcetVote < CondorcetVote - def result - PureCondorcetResult.new( self ) + def resultFactory(init) + PureCondorcetResult.new(init) end end class CloneproofSSDVote < CondorcetVote - def result - CloneproofSSDResult.new( self ) + def resultFactory(init) + CloneproofSSDResult.new(init) end end