]> projects.mako.cc - selectricity/blob - app/models/raw_voter_list.rb
updated docs for git
[selectricity] / app / models / raw_voter_list.rb
1 # Selectricity: Voting Machinery for the Masses
2 # Copyright (C) 2007, 2008 Benjamin Mako Hill <mako@atdot.cc>
3 # Copyright (C) 2007 Massachusetts Institute of Technology
4 #
5 # This program is free software. Please see the COPYING file for
6 # details.
7
8 class RawVoterList
9
10   attr_accessor :email
11   attr_accessor :input_addresses
12
13   include Enumerable
14
15   def initialize(params={})
16     @email = params[:email].to_i || 1
17     @input_addresses = params[:input_addresses] || String.new
18   end
19
20   def email=(email)
21     @email = email
22   end
23   
24   def each
25     @input_addresses.split("\n").each do |address|
26       yield FullVoter.new( { :email => address } ) 
27     end
28   end
29 end

Benjamin Mako Hill || Want to submit a patch?