D
donn
I'm looking for the best method of coding. I have module. "module
Standards." It consists of production standard constants and methods
that will be called from all over the place. It is gem'd, and is
implemented with a require method. I would like to change some of the
constants over to accessor variables, so I can change certain settings
on the fly (for testing purposes.) I would like the accessor variable
to have a default value, but I don't know to accomplish this. (Can I
even have accessor variables/methods in a module?) I would like to get
things as simple as this:
attr :lpClientDrive, true # like to have default value here
....
def lpClientDrive=(dr)
@lpClientDrive = dr
end
What I currently have (without ability to update) is
def lpClientDrive; "//server/folder/foo/"; end
For testing purposes, I would like to re assign the client drive, as
testing will be done on a non-production machine.
Standards." It consists of production standard constants and methods
that will be called from all over the place. It is gem'd, and is
implemented with a require method. I would like to change some of the
constants over to accessor variables, so I can change certain settings
on the fly (for testing purposes.) I would like the accessor variable
to have a default value, but I don't know to accomplish this. (Can I
even have accessor variables/methods in a module?) I would like to get
things as simple as this:
attr :lpClientDrive, true # like to have default value here
....
def lpClientDrive=(dr)
@lpClientDrive = dr
end
What I currently have (without ability to update) is
def lpClientDrive; "//server/folder/foo/"; end
For testing purposes, I would like to re assign the client drive, as
testing will be done on a non-production machine.