Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/mean/sum.rb,
lib/mean/mean.rb
Instance Method Summary collapse
Instance Method Details
#mean ⇒ Object
2 3 4 |
# File 'lib/mean/mean.rb', line 2 def mean sum / size end |
#sum ⇒ Object
2 3 4 |
# File 'lib/mean/sum.rb', line 2 def sum inject(nil){|sum, x| sum ? sum + x : x} end |