Project

mean

0.0
No commit activity in last 3 years
No release in over 3 years
Monkeypatches Ruby's Array Class to add "sum" and "mean" methods.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 2.3.2
 Project Readme

mean¶ ↑

DESCRIPTION:¶ ↑

Monkeypatches Ruby’s Array Class to add “sum” and “mean” methods.

FEATURES:¶ ↑

  • Find the mean of an array of integers

    ** BONUSWTFBBQ **

    • Also find the sum of an array of integers

SYNOPSIS:¶ ↑

$ python
>>> sum([1, 2, 3])
6

Hmm...

$ irb
>> [1, 2, 3].sum
=> NoMethodError: undefined method `sum' for [1, 2, 3]:Array

:-( :-( :-( :-(

Hmm...

>> require 'rubygems'
>> require 'mean'
>> [1, 2, 3].sum
=> 6

:-) :-) :-) :-)

$ [1, 2, 3].mean
=> 2

:-D :-D :-D :-D !!!

INSTALL:¶ ↑

sudo gem install mean

LICENSE:¶ ↑

(The WTFPL License)

Copyright (c) 2009 Bryan Woods

           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
                   Version 2, December 2004

Copyright (C) 2004 Sam Hocevar
 14 rue de Plaisance, 75014 Paris, France
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.

           DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
  TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

 0. You just DO WHAT THE FUCK YOU WANT TO.