Ruby - Class Methods and Variables
Which syntax correctly reopens the Integer class to add a method
double?double?class ClassName followed by method definitions.double. def Integer.double
self * 2
end tries to define a singleton method incorrectly. The options using class Integer.new and class Integer() have invalid syntax.class ClassName [OK]15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions