Sha256: da31d6f86422e408daf9aeca3a592e0440bb9db47cd37b1de8b7d093cd5d8779

Contents?: true

Size: 563 Bytes

Versions: 11

Compression:

Stored size: 563 Bytes

Contents

module ActiveReporter
  module Serializer
    class Table < Base
      def headers
        report.groupers.map(&method(:human_dimension_label)) + [human_aggregator_label(report.all_aggregators)]
      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.all_aggregators, y)]
        end
      end

      def caption
        axis_summary
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
active_reporter-0.7.1 lib/active_reporter/serializer/table.rb
active_reporter-0.6.5 lib/active_reporter/serializer/table.rb
active_reporter-0.6.4 lib/active_reporter/serializer/table.rb
active_reporter-0.6.3 lib/active_reporter/serializer/table.rb
active_reporter-0.6.2 lib/active_reporter/serializer/table.rb
active_reporter-0.6.1 lib/active_reporter/serializer/table.rb
active_reporter-0.6.0 lib/active_reporter/serializer/table.rb
active_reporter-0.5.13 lib/active_reporter/serializer/table.rb
active_reporter-0.5.12 lib/active_reporter/serializer/table.rb
active_reporter-0.5.11 lib/active_reporter/serializer/table.rb
active_reporter-0.5.10 lib/active_reporter/serializer/table.rb