]> projects.mako.cc - selectricity/blob - app/models/raw_voter_list.rb
added template left out from last committ by accident
[selectricity] / app / models / raw_voter_list.rb
1 class RawVoterList
2
3   attr_accessor :email
4   attr_accessor :input_addresses
5
6   include Enumerable
7
8   def initialize(params={})
9     @email = params[:email].to_i || 1
10     @input_addresses = params[:input_addresses] || String.new
11   end
12
13   def email=(email)
14     @email = email
15   end
16   
17   def each
18     @input_addresses.split("\n").each do |address|
19       yield FullVoter.new( { :email => address } ) 
20     end
21   end
22 end

Benjamin Mako Hill || Want to submit a patch?