Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/core_extensions/array.rb
Instance Method Summary collapse
Instance Method Details
#mean ⇒ Object
33 34 35 |
# File 'lib/core_extensions/array.rb', line 33 def mean sum.to_f / size end |
#sum ⇒ Object
29 30 31 |
# File 'lib/core_extensions/array.rb', line 29 def sum inject( nil ) { |sum,x| sum ? sum + x : x } end |