Sha256: 1736f0785b42a8a5306c94e0f482d093635405a258ceba631af2c8377c47875d

Contents?: true

Size: 350 Bytes

Versions: 3

Compression:

Stored size: 350 Bytes

Contents

module Csv2hash
  module Discover

    def find_positions!
      definition.cells.each do |cell|
        y, x = cell.rules.fetch :position
        if y.is_a?(Array)
          column, matcher = y
          y = data_source.index { |entries| entries[column] =~ matcher }
          cell.rules[:position] = [y, x]
        end
      end
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
csv2hash-0.6.4 lib/csv2hash/discover.rb
csv2hash-0.6.3 lib/csv2hash/discover.rb
csv2hash-0.6.2 lib/csv2hash/discover.rb