Added a series of files so that elections can be created and edited and
[selectricity] / app / models / raw_voter_list.rb
diff --git a/app/models/raw_voter_list.rb b/app/models/raw_voter_list.rb
new file mode 100644 (file)
index 0000000..2f7cb28
--- /dev/null
@@ -0,0 +1,22 @@
+class RawVoterList
+
+  attr_accessor :email
+  attr_accessor :input_addresses
+
+  include Enumerable
+
+  def initialize(params={})
+    @email = params[:email] || 1
+    @input_addresses = params[:input_addresses] || String.new
+  end
+
+  def email=(email)
+    @email = email
+  end
+  
+  def each
+    @input_addresses.split("\n").each do |address|
+      yield Voter.new( { :email => address } ) 
+    end
+  end
+end

Benjamin Mako Hill || Want to submit a patch?