Module: StatsHash

Instance Method Summary collapse

Instance Method Details

#create_stats_hash(data) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
# File 'lib/helpers/stats_hash.rb', line 2

def create_stats_hash(data)
  stats = []
  data['rowSet'].each do |row|
    row_hash = {}
    data['headers'].each_with_index do |header, index|
      row_hash[header] = row[index]
    end
    stats << row_hash
  end
  stats
end