M
makoto kuwata
Is it possible to call parent method specifying method name explicitly
like super.foobar() or parent::foobar()?
class Parent
def hello(name)
puts "Hello #{name}!"
end
end
class Child
def hello(name)
# ...
_hello(name)
# ...
end
private
def _hello(name)
# ...
super(name) # want to call Parent#hello(), not _hello()
# ...
end
end
like super.foobar() or parent::foobar()?
class Parent
def hello(name)
puts "Hello #{name}!"
end
end
class Child
def hello(name)
# ...
_hello(name)
# ...
end
private
def _hello(name)
# ...
super(name) # want to call Parent#hello(), not _hello()
# ...
end
end