Files
codeocean/config/initializers/monkey_patches.rb
Hauke Klement bfc11c333a added test
2015-02-24 11:47:29 +01:00

16 lines
218 B
Ruby

unless Array.respond_to?(:average)
class Array
def average
inject(:+) / length unless blank?
end
end
end
unless Array.respond_to?(:to_h)
class Array
def to_h
Hash[self]
end
end
end