Sha256: d76b66a653bab841cead2ba78a50a63c1bcfd48262ad25745e29f5c0e9e018d6

Contents?: true

Size: 225 Bytes

Versions: 9

Compression:

Stored size: 225 Bytes

Contents

module Enumerable
 def ave
   sum = 0
   self.each{|value| sum += value}
   return sum.to_f/self.length
 end

  if RUBY_VERSION < '1.9.0'
    def sample
     me = to_a
     me[rand(me.length)]
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sane-0.25.8 lib/sane/enumerable.rb
sane-0.25.7 lib/sane/enumerable.rb
sane-0.25.6 lib/sane/enumerable.rb
sane-0.25.5 lib/sane/enumerable.rb
sane-0.25.4 lib/sane/enumerable.rb
sane-0.25.3 lib/sane/enumerable.rb
sane-0.25.2 lib/sane/enumerable.rb
sane-0.25.1 lib/sane/enumerable.rb
sane-0.25.0 lib/sane/enumerable.rb