Module: Summaryse

Defined in:
lib/summaryse.rb,
lib/summaryse/version.rb

Defined Under Namespace

Modules: Version

Constant Summary

BYPASS =

Bypass marker

Object.new
VERSION =
Version.to_s

Class Method Summary (collapse)

Class Method Details

+ (Object) aggregator(name)

Returns an aggregator by name, nil if no such aggregator as been previously registered.



27
28
29
# File 'lib/summaryse.rb', line 27

def self.aggregator(name)
  @aggregators && @aggregators[name]
end

+ (Object) register(name, &lambda)

Registers a aggregation function under a given name.

The lambda function is converted as a Proc from the supplied block. It takes one array argument, on which the aggregation must be done and returned.



18
19
20
21
# File 'lib/summaryse.rb', line 18

def self.register(name, &lambda)
  @aggregators ||= {}
  @aggregators[name] = lambda
end