Sha256: 678e717a0f790a3aff255215b911f1343952f6b4bf084e78eaae15c4bf3ea34c

Contents?: true

Size: 247 Bytes

Versions: 11

Compression:

Stored size: 247 Bytes

Contents

require 'csv'

module Csv2hash
  class CsvArray < Array

    def to_csv options = {}
      CSV.generate(options) do |csv|
        self.each do |element|
          csv << [element[:value], element[:message]]
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
csv2hash-0.7.7 lib/csv2hash/csv_array.rb
csv2hash-0.7.6 lib/csv2hash/csv_array.rb
csv2hash-0.7.5 lib/csv2hash/csv_array.rb
csv2hash-0.7.3 lib/csv2hash/csv_array.rb
csv2hash-0.7.2 lib/csv2hash/csv_array.rb
csv2hash-0.7.1 lib/csv2hash/csv_array.rb
csv2hash-0.7.0 lib/csv2hash/csv_array.rb
csv2hash-0.6.8 lib/csv2hash/csv_array.rb
csv2hash-0.6.7 lib/csv2hash/csv_array.rb
csv2hash-0.6.6 lib/csv2hash/csv_array.rb
csv2hash-0.6.5 lib/csv2hash/csv_array.rb