Sha256: a453af2ed58ba8bcf25e5f873c6088b195c25454d66c1fba5dab99d3405a218a

Contents?: true

Size: 565 Bytes

Versions: 4

Compression:

Stored size: 565 Bytes

Contents

module Repor
  module Serializers
    class TableSerializer < BaseSerializer
      def headers
        report.groupers.map(&method(:human_dimension_label)) + [human_aggregator_label(report.aggregator)]
      end

      def each_row
        return to_enum(__method__) unless block_given?

        report.flat_data.each do |xes, y|
          yield report.groupers.zip(xes).map { |d, v| human_dimension_value_label(d, v) } + [human_aggregator_value_label(report.aggregator, y)]
        end
      end

      def caption
        axis_summary
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
repor-0.1.0 lib/repor/serializers/table_serializer.rb
repor-0.0.5 lib/repor/serializers/table_serializer.rb
repor-0.0.4 lib/repor/serializers/table_serializer.rb
repor-0.0.3 lib/repor/serializers/table_serializer.rb