J
John
How does one get a reference to a previously created object?
Here's the scenario. I'm writing a web application, so there's a
listener object that listens to incoming requests and spins off a
thread for each request. Each thread has a Context object, which holds
things like POST arguments, browser type, etc.
Suppose a request comes in, a thread is spun, and it finds a template
object for that page, fills it with text from a database, and now I
want to run macros. Finding and running macros is ridiculously easy
due to Ruby's regex support. But I want macros to have access to the
Context in which they are running. Is there any way to do this aside
from passing a reference along with each call?
Here's the scenario. I'm writing a web application, so there's a
listener object that listens to incoming requests and spins off a
thread for each request. Each thread has a Context object, which holds
things like POST arguments, browser type, etc.
Suppose a request comes in, a thread is spun, and it finds a template
object for that page, fills it with text from a database, and now I
want to run macros. Finding and running macros is ridiculously easy
due to Ruby's regex support. But I want macros to have access to the
Context in which they are running. Is there any way to do this aside
from passing a reference along with each call?