Ruby on Rails: Passing argument to singleton -
I have a railway app that repeatedly talks to another web server through a cover, and I want to stick in the cover is a single square, so it has not been created for every request. Quite easy, I thought:
class AppWrapper & lt; Cover singleton is included in the end ... Cover = AppWrapper.instance "Url"
Only this does not work:
Wrong number of arguments (0 1) /usr/lib/ruby/1.8/singleton.rb:94:in`start '/usr/lib/ruby/1.8/singleton.rb: 94: in` new' /usr/lib/ruby/1.8 / Singleton .rb: 94: `example 'in
Wrapper.in initialization requires an argument, and apparently it is not being passed, since the question is in line 94
@__ example__ = new # showing, no logic
How do I work on it? Start in AppWrapper does not seem to help redefine, and mucking around with the wrapper seems to be different from "starting" to "set url".
Comments
Post a Comment