Sha256: 07010ce7a9e09641dd500975b4b7de1abd0c52cfb6fc4041378c98fed1f1717b

Contents?: true

Size: 243 Bytes

Versions: 5

Compression:

Stored size: 243 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 generate_csv
    CSV.generate do |csv|
      each { |hash| csv << hash.values }
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
mumukit-content-type-1.12.1 vendor/bundle/ruby/2.7.0/gems/mumukit-core-1.19.2/lib/mumukit/core/array.rb
mumukit-core-1.19.2 lib/mumukit/core/array.rb
mumukit-core-1.20.0 lib/mumukit/core/array.rb
mumukit-content-type-1.12.0 vendor/bundle/ruby/2.7.0/gems/mumukit-core-1.19.1/lib/mumukit/core/array.rb
mumukit-core-1.19.1 lib/mumukit/core/array.rb