Sha256: 6d17e2bfc32a6ba65492965cfba20aed3b95c473b42f8e1c68951ea2a2da1397

Contents?: true

Size: 237 Bytes

Versions: 3

Compression:

Stored size: 237 Bytes

Contents

require 'csv'

class Array
  def merge_numbers!(key=:number)
    self.each_with_index do |r, i|
      r.send "#{key}=", i+1
    end
  end

  def to_csv
    CSV.generate do |csv|
      each { |hash| csv << hash.values }
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
mumukit-core-1.19.0 lib/mumukit/core/array.rb
mumukit-content-type-1.11.1 vendor/bundle/ruby/2.6.0/gems/mumukit-core-1.18.0/lib/mumukit/core/array.rb
mumukit-core-1.18.0 lib/mumukit/core/array.rb