X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/c405443c19a18c645aacc16848502f5b91461feb..6dfbfbec4b0d01138c272649d668c5a872706a5c:/lib/rubyvote/election.rb diff --git a/lib/rubyvote/election.rb b/lib/rubyvote/election.rb index fc61840..3d816a8 100644 --- a/lib/rubyvote/election.rb +++ b/lib/rubyvote/election.rb @@ -61,6 +61,11 @@ class ElectionVote def tally_vote self.verify_vote(vote) end + + def filter_out(winner) + @candidates.delete_if {|x| winner.winners.include?(x)} + end + end class PluralityVote < ElectionVote @@ -70,7 +75,7 @@ class PluralityVote < ElectionVote protected def verify_vote(vote=nil) - vote ? true : false + vote.instance_of?( String ) end def tally_vote(candidate)