S
Steve V
I created the following small singleton class, but it seems that my
variables are ignored.
require 'singleton'
class Context
include Singleton
@companyname = "acme"
def company()
return @companyname
end
def change(name)
@companyname = name
end
end
If I set the @companyname variable within the company function, and then
return it, the value is there. After that though, it seems that the variable
just disappears. What am I doing wrong?
Thanks,
Steve
variables are ignored.
require 'singleton'
class Context
include Singleton
@companyname = "acme"
def company()
return @companyname
end
def change(name)
@companyname = name
end
end
If I set the @companyname variable within the company function, and then
return it, the value is there. After that though, it seems that the variable
just disappears. What am I doing wrong?
Thanks,
Steve