T
Tod
I have been working with Ruby for a few months now and have hit upon
something that I can't find the answer to: what does the code look like
for passing messages back and forth between objects. Here is a specific
example: In a web application (I am not using ROR) I have a CGI object
and an object whose superclass is Active Record. The CGI object
receives some params from POST and makes them available to the Active
Record object. Not surprisingly, the Active Record object does some
work with a database. Here's where I am stumped how do I have the
ActiveRecord Object tell the CGI object that it is done working with
the database and the CGI object may now do something else.
I have made a particularly in-elegant work-around by having the ActRec
object set a global variable to something when it is done and follow
this with a conditional that checks to see if that global variable was
set and if it is then the CGI object can proceed. But there has to be a
more direct way to do this. Also, if I wanted to pass things back and
forth between objects this would not work.
I am sure the examples are out there so I must be looking in the wrong
place or trying to call it something it is not.
Thank you. Tod
something that I can't find the answer to: what does the code look like
for passing messages back and forth between objects. Here is a specific
example: In a web application (I am not using ROR) I have a CGI object
and an object whose superclass is Active Record. The CGI object
receives some params from POST and makes them available to the Active
Record object. Not surprisingly, the Active Record object does some
work with a database. Here's where I am stumped how do I have the
ActiveRecord Object tell the CGI object that it is done working with
the database and the CGI object may now do something else.
I have made a particularly in-elegant work-around by having the ActRec
object set a global variable to something when it is done and follow
this with a conditional that checks to see if that global variable was
set and if it is then the CGI object can proceed. But there has to be a
more direct way to do this. Also, if I wanted to pass things back and
forth between objects this would not work.
I am sure the examples are out there so I must be looking in the wrong
place or trying to call it something it is not.
Thank you. Tod