Class: TotalRecall::ParseStrategy::Ing
- Inherits:
-
Object
- Object
- TotalRecall::ParseStrategy::Ing
- Defined in:
- lib/total_recall.rb
Class Method Summary collapse
Instance Method Summary collapse
- #options ⇒ Object
-
#parse_row(row) ⇒ Object
Expected: Hash with: :amount => Float, :currency => String, :description => String, :date => Date.
Class Method Details
.options ⇒ Object
26 27 28 |
# File 'lib/total_recall.rb', line 26 def self. {:col_sep => ",", :headers => true} end |
Instance Method Details
#options ⇒ Object
30 31 32 |
# File 'lib/total_recall.rb', line 30 def self.class. end |
#parse_row(row) ⇒ Object
Expected: Hash with: :amount => Float, :currency => String, :description => String, :date => Date
15 16 17 18 19 20 21 22 23 |
# File 'lib/total_recall.rb', line 15 def parse_row(row) amount = row[6].sub(/,/,'.').to_f { :amount => (row[5] == 'Bij' ? amount : -amount), :date => Date.parse(row[0]), :description => [row[1], row[8]].map{|i| i.strip.gsub(/\s+/, ' ')}.join(' '), :currency => 'EUR' } end |