Sha256: 0d5d4b5b3b406ae88b2b0c99022af6cc13bf22993ac07e1e0677257f6ea7c00d

Contents?: true

Size: 393 Bytes

Versions: 10

Compression:

Stored size: 393 Bytes

Contents

require 'csv'

module BankScrap
  module Exporter
    class Csv
      HEADERS = %w(Date Description Amount).freeze

      def initialize(output = nil)
        @output = output || 'transactions.csv'
      end

      def write_to_file(data)
        CSV.open(@output, 'wb') do |csv|
          csv << HEADERS
          data.each { |line| csv << line.to_a }
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
bankscrap-2.0.5 lib/bankscrap/exporters/csv.rb
bankscrap-2.0.4 lib/bankscrap/exporters/csv.rb
bankscrap-2.0.3 lib/bankscrap/exporters/csv.rb
bankscrap-2.0.2 lib/bankscrap/exporters/csv.rb
bankscrap-2.0.1 lib/bankscrap/exporters/csv.rb
bankscrap-2.0.0 lib/bankscrap/exporters/csv.rb
bankscrap-1.0.4 lib/bankscrap/exporters/csv.rb
bankscrap-1.0.3 lib/bankscrap/exporters/csv.rb
bankscrap-1.0.2 lib/bankscrap/exporters/csv.rb
bankscrap-1.0.1 lib/bankscrap/exporters/csv.rb