Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/stdlib/ext/array.rb

Instance Method Summary collapse

Instance Method Details

#meanObject



7
8
9
10
11
# File 'lib/stdlib/ext/array.rb', line 7

def mean
  sum=0
  self.each{|v| sum+=v }
  sum/self.size
end

#tailObject



3
4
5
# File 'lib/stdlib/ext/array.rb', line 3

def tail
  self[1..-1]
end