Sha256: efe6ad11c50dfde296d3408e0b68a8ac8584e0d436d5cab318ae333f67cb0562

Contents?: true

Size: 464 Bytes

Versions: 2

Compression:

Stored size: 464 Bytes

Contents

module ActiveReporter
  module Serializer
    class HashTable < Base
      def table
        fields = (report.grouper_names + report.aggregators.keys)
        titles = report.groupers.map(&method(:human_dimension_label)) + report.aggregators.collect { |k, v| human_aggregator_label({ k => v }) }

        [fields.zip(titles).to_h] + report.hashed_data.collect { |row| row.map { |k,v| [k, (v.respond_to?(:min) ? v.min : v).to_s] }.to_h}
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
active_reporter-0.5.9 lib/active_reporter/serializer/hash_table.rb
active_reporter-0.5.8 lib/active_reporter/serializer/hash_table.rb