Class: TotalRecall::ParseStrategy::Abn

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

Overview

/Ing

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.optionsObject



52
53
54
# File 'lib/total_recall.rb', line 52

def self.options
  {:col_sep => "\t"}
end

Instance Method Details

#optionsObject



56
57
58
# File 'lib/total_recall.rb', line 56

def options
  self.class.options
end

#parse_row(row) ⇒ Object

Expected: Hash with: :amount => Float, :currency => String, :description => String, :date => Date



43
44
45
46
47
48
49
50
# File 'lib/total_recall.rb', line 43

def parse_row(row)
  {
    :amount => row[6].sub(/,/,'.').to_f,
    :date => Date.parse(row[2]),
    :description => row[7].strip.gsub(/\s+/,' '),
    :currency => row[1]
  }
end