Class: YnabTw::Cathay::Converter

Inherits:
Object
  • Object
show all
Includes:
YnabTw::Converter
Defined in:
lib/ynab_tw/cathay/converter.rb

Instance Method Summary collapse

Methods included from YnabTw::Converter

#convert, #parse

Instance Method Details

#convert_format(csv) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/ynab_tw/cathay/converter.rb', line 14

def convert_format(csv)
  csv.each.map do |row|
    [
      DateTime.parse(row["date"]).strftime("%m/%d/%Y"),
      row["info"],
      nil,
      "#{row["memo"]} #{row["extra"]}",
      row["withdraw"],
      row["deposit"],
    ]
  end
end

#input_headersObject



10
11
12
# File 'lib/ynab_tw/cathay/converter.rb', line 10

def input_headers
  %w{date withdraw deposit balance info memo extra}
end

#useless_header_countObject



6
7
8
# File 'lib/ynab_tw/cathay/converter.rb', line 6

def useless_header_count
  2
end