Hello,
I want to have an instance of a Ruby class I wrote initialized as a single instance on app startup, and have that instance accessible from my controllers. I assume this is simple, but have not been able to figure this out.
Where do I initialize the class? And how can I access it from my controllers?
I assume it is something like (env.rb......
''' $myclassinstance = MyClass.new ''' and then (foobar-controller.rb........ ''' def foo @myvars = $myclassinstance.mymethod( params[:somevar] ) end ''' Thanks for reading,
M