oop/test/super_simple.rb
tests/_examples/oop/test/super_simple.rb in the metorex repository.
class A
def foo
"A"
end
end
class B < A
def foo
super + "B"
end
end
b = B.new
puts b.foo
Output:
AB
tests/_examples/oop/test/super_simple.rb in the metorex repository.
class A
def foo
"A"
end
end
class B < A
def foo
super + "B"
end
end
b = B.new
puts b.foo
Output:
AB