From: Logan Capaldo Date: 2006-03-10T08:13:45+09:00 Subject: Re: globals outside of OO scripting On Mar 9, 2006, at 3:38 AM, rtilley wrote: > Logan Capaldo wrote: > >> Depends. Why are you accessing it outside the class? If its to >> change its value, than thats probably not a good idea and that >> functionality should be put into a method. Of course if its really >> a constant, well then its ok. > > It's a filepath (c:\name_of_file) I only wanted to define the path > once and be able to read it inside and outside the class. I am not > changing it. > Hmm, this makes me wonder if maybe your class should look like this: class NeedsAPath def initialize(path, ...) @path = path ... end ... end ... obj = NeedsAPath.new('c:\name_of_file')