Class: PrinceMerge::Recipient

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/prince_merge.rb

Class Method Summary collapse

Class Method Details

.load_from_csv(file) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/prince_merge.rb', line 30

def self.load_from_csv(file)
  recipients = []
  CSV.foreach(file, :headers => true) do |row|
    recipients << new(row.to_hash.delete_if {|k,v| k == nil})
  end
  recipients
end