Module: Mathstats::Mixin

Defined in:
lib/mathstats.rb

Overview

All the class methods from Mathstats above are available in the Mixin module, via delegation. This module can be included in any class that has a method #to_a like Array

Class Method Summary collapse

Class Method Details

.delegate_to_mathstats(*symbols) ⇒ Object



59
60
61
62
63
64
65
66
67
# File 'lib/mathstats.rb', line 59

def self.delegate_to_mathstats(*symbols)
  Array(symbols).each do |symbol|
    class_eval "      def \#{symbol}(*args, &block)\n        Mathstats.\#{symbol}(self.to_a, *args, &block)\n      end\n    EOS\n  end\nend\n", __FILE__, __LINE__ + 1