Class: RDFgrid::Reducer::SumReducer

Inherits:
show all
Defined in:
lib/rdfgrid/reducer.rb

Constant Summary

Constants inherited from RDFgrid::Processor

SEPARATOR

Instance Method Summary

Methods inherited from

#call, #parser, process

Methods inherited from RDFgrid::Processor

#initialize, process!

Constructor Details

This class inherits a constructor from RDFgrid::Processor

Instance Method Details

- (Object) process(values) {|values.inject(0){ ... }| ... }

Yields:

  • (values.inject(0){ ... })


53
54
55
# File 'lib/rdfgrid/reducer.rb', line 53

def process(values)
  yield values.inject(0) { |sum, value| sum + parser.call(value) }
end