Sha256: f5804163da9964edfca6a76e5e32b8a58a52369fc4548359fa54016278810dc3

Contents?: true

Size: 209 Bytes

Versions: 12

Compression:

Stored size: 209 Bytes

Contents

require 'csv'
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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
csv2hash-0.6.4 lib/csv2hash/csv_array.rb
csv2hash-0.6.3 lib/csv2hash/csv_array.rb
csv2hash-0.6.2 lib/csv2hash/csv_array.rb
csv2hash-0.6.1 lib/csv2hash/csv_array.rb
csv2hash-0.6.0 lib/csv2hash/csv_array.rb
csv2hash-0.5.0 lib/csv2hash/csv_array.rb
csv2hash-0.4.0 lib/csv2hash/csv_array.rb
csv2hash-0.3.0 lib/csv2hash/csv_array.rb
csv2hash-0.2.1 lib/csv2hash/csv_array.rb
csv2hash-0.2.0 lib/csv2hash/csv_array.rb
csv2hash-0.1.1 lib/csv2hash/csv_array.rb
csv2hash-0.1 lib/csv2hash/csv_array.rb