class Array

Adding the sum and average methods to the default array

Public Instance Methods

average() click to toggle source
# File lib/bigbench/post_processor/environment.rb, line 22
def average
  result = sum / size.to_f
  result.nan? ? 0 : result
end
sum() click to toggle source
# File lib/bigbench/post_processor/environment.rb, line 18
def sum
  reduce(:+).to_f
end