Sha256: 103ef27961af7797c199c79834d1e564fd737107e05ff24f9199a36a9bc7e6f8
Contents?: true
Size: 1.38 KB
Versions: 2
Compression:
Stored size: 1.38 KB
Contents
# encoding: utf-8 module Axiom module Algebra class Summarization # Summaries for all aggregate functions class Summaries # Initialize Summaries # # @param [Relation::Header] header # # @param [Hash{Symbol => #call}] summarizers # # @return [undefined] # # @api private def initialize(header, summarizers) @header = header @summaries = {} summarizers.each do |name, summarizer| @summaries[name] = Summary.new(summarizer) end end # Execute all summarizers with the tuple, summarized by the header # # @example # summaries = summaries.summarize_by(header, tuple) # # @param [Tuple] tuple # # @return [self] # # @api public def summarize_by(tuple) projection = tuple.project(@header) @summaries.each_value do |summary| summary.summarize_by(projection, tuple) end self end # Return the summaries as a Hash # # @example # hash = summaries.to_hash # # @return [Hash] # # @api public def to_hash @summaries end end # class Summaries end # class Summarization end # module Algebra end # module Axiom
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
axiom-0.2.0 | lib/axiom/algebra/summarization/summaries.rb |
axiom-0.1.1 | lib/axiom/algebra/summarization/summaries.rb |