What is .Instance?

With observers, you have to do (according to AWDWR):

ItemObserver.Instance

What is ‘.Instance’? I’ve looked in both the Rails and Ruby docs and
don’t see any mention. I presume it’s like ‘new’?

thanks
csn

On 1/30/06, csn [email protected] wrote:

With observers, you have to do (according to AWDWR):

ItemObserver.Instance

What is ‘.Instance’? I’ve looked in both the Rails and Ruby docs and
don’t see any mention. I presume it’s like ‘new’?

thanks
csn

It’s a class method of ActiveRecord::Observer that instantiates the
observer and starts observing its classes. You can use the observer
helper for controllers, however:

observer :people_observer


Rick O.
http://techno-weenie.net

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs