D
dc
hi -
i understand super passes method calls up to the parent.
is there a way to call down to the child instance, to a different method?
I realize i could pass a function block up to super, and then use
yield to call back to the child, but i want to hide this complexity
from my child classes.
the setup is something like this:
class Webserver < HTTPServlet::AbstractServlet
def do_GET(request, response)
// here i want to hand off to the instance child servlet to
handle the response
child.render()
end
end
class Servlet1 < Webserver
def render
// do some stuff
end
end
etc for other servlets.
I guess the other way is to instantiate the right child servlet in the
webserver, but this means i dont get access to super methods...
tx,
/dc
i understand super passes method calls up to the parent.
is there a way to call down to the child instance, to a different method?
I realize i could pass a function block up to super, and then use
yield to call back to the child, but i want to hide this complexity
from my child classes.
the setup is something like this:
class Webserver < HTTPServlet::AbstractServlet
def do_GET(request, response)
// here i want to hand off to the instance child servlet to
handle the response
child.render()
end
end
class Servlet1 < Webserver
def render
// do some stuff
end
end
etc for other servlets.
I guess the other way is to instantiate the right child servlet in the
webserver, but this means i dont get access to super methods...
tx,
/dc