Ruby - Class Methods and Variables
This code tries to reopen the
Integer class to add a method double. What is wrong?class Integer
def double
self * 2
end
end
puts 5.double()