J
Jonathan Leighton
Hi,
I have a singleton class, as in one that does "include Singleton". I
want to run a few methods when the instance is created. Usually one
would do that in initialize(), but obviously I can't do that here. This
is what I've thought of but it raises an error which says "super: no
superclass method `instance'"
class SingletonClass < ParentClass
include Singleton
def self.instance
super
# initialization code here
end
end
What am I doing wrong?
Cheers
I have a singleton class, as in one that does "include Singleton". I
want to run a few methods when the instance is created. Usually one
would do that in initialize(), but obviously I can't do that here. This
is what I've thought of but it raises an error which says "super: no
superclass method `instance'"
class SingletonClass < ParentClass
include Singleton
def self.instance
super
# initialization code here
end
end
What am I doing wrong?
Cheers