class YnabTw::Cathay::CreditConverter

Public Instance Methods

convert_format(csv) click to toggle source
# File lib/ynab_tw/cathay/credit_converter.rb, line 14
def convert_format(csv)
  valid_rows = csv.each.reject do |row|
    row["date"].nil?
  end
  valid_rows.each.map do |row|
    [
      row["date"] + DateTime.now.strftime("/%Y"),
      row["info"],
      nil,
      "card_no:#{row["card_no"]}",
      row["withdraw"],
      0,
    ]
  end
end
input_headers() click to toggle source
# File lib/ynab_tw/cathay/credit_converter.rb, line 10
def input_headers
    %w{date charge_date info withdraw card_no mobi_card_no country currency foreign_amount exchange_date}
end
useless_header_count() click to toggle source
# File lib/ynab_tw/cathay/credit_converter.rb, line 6
def useless_header_count
  3
end