Module: Mutest::Result::ClassMethods Private
- Defined in:
- lib/mutest/result.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class level mixin
Instance Method Summary collapse
-
#sum(name, collection) ⇒ undefined
private
Generate a sum method from name and collection.
Instance Method Details
#sum(name, collection) ⇒ undefined
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Generate a sum method from name and collection
32 33 34 35 36 37 |
# File 'lib/mutest/result.rb', line 32 def sum(name, collection) define_method(name) do public_send(collection).map(&name).reduce(0, :+) end memoize(name) end |