Sha256: 7e23b17c346918921b86e0417e2bcd5bd09a29ef7d10f1a05405ce416c7d20ea
Contents?: true
Size: 652 Bytes
Versions: 26
Compression:
Stored size: 652 Bytes
Contents
module Cucumber module Model class Table attr_accessor :raw # Creates a new table. The +raw+ argument should be an array # of arrays def initialize(raw) @raw = raw end # Turn the table into an array of Hash where each Hash # has keys corresponding to the table header (first line) # and the values are the individual row cells. def hashes header = @raw[0] @raw[1..-1].map do |row| h = {} row.each_with_index do |v,n| key = header[n] h[key] = v end h end end end end end
Version data entries
26 entries across 26 versions & 6 rubygems