class Fixnum
alias :plus :+
def + other
if self == 1
plus(other).plus 1
else
plus(other)
end
end
end
puts 1 + 2
puts 2 + 2
puts (1 + 2) == (2 + 2)
yes, it outputs:
4
4
true
class Fixnum
alias :plus :+
def + other
if self == 1
plus(other).plus 1
else
plus(other)
end
end
end
puts 1 + 2
puts 2 + 2
puts (1 + 2) == (2 + 2)
yes, it outputs:
4
4
true