From: Robert Klemme Date: 2006-05-08T20:14:21+09:00 Subject: Re: how to call a class from another file 2006/5/8, huseyin polat : > Hi everyone, I had this little problem and having no luck so far. I have > external file called > > require 'query-eval' # here the name of the file required query-eval.rb > > then there is this class in query-eval.rb that I want to call from my > program that is saved as a different file and IS in the same directory. > Following the instruction in file I had following three line code that > gives error. I think it is because QueryEval is a class not a method. is > there a way to call class without hassle? thank you > > filename='rlv-ass' # another external file > qe = QueryEval(filename) > qe.process_query_results(sorteddocs,1) > > ERROR : > project4.rb:243: undefined method `QueryEval' for # > (NoMethodError) You're problem is almost certainly connected to the fact that there's no "new" in your code. You probably meant qe = QueryEval.new filename Kind regards robert -- Have a look: http://www.flickr.com/photos/fussel-foto/