Sha256: 01bf044bd455199ffd6a53494cab58898ad1d2c20afe8d5cb8563ef79c30f0ac

Contents?: true

Size: 381 Bytes

Versions: 22

Compression:

Stored size: 381 Bytes

Contents

module SuperFormatter
  class Import < SuperProcess::Core
    init :spreadsheet
    attr_accessor :head, :rows, :orders

    protected

    def build_rows!(head_klass, row_klass)
      self.head = head_klass.new(spreadsheet.result.shift)
      self.rows = spreadsheet.result.map.with_index do |data, i|
        row_klass.new(data, head.indexes)
      end.compact
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
super_tools-0.0.2 lib/super_formatter/import.rb
super_tools-0.0.1 lib/super_formatter/import.rb