From: Scott D_o Date: 2006-10-17T11:24:01+09:00 Subject: Re: using classes problem Gavin Kistner wrote: > From: Scott D_o >> I am trying to use a class that I wrote in another file, and >> it doesn't >> seem to want to work. At the beginning of the file that I do [require >> 'classname'] with the single quotes > > a) What is the name of the file that you put your class in? > b) Where is the file, relative to the file that has the "require" line > in it? Ok so here is some code that is having the problem with the require. I tested out some programs from rubyforge, and it gave me the same error. ----------------------------------------------------------------- TestClass two seperate files ----------------------------------------------------------------- class TestClass def testMethod() return "Hello I am in TestClass" end end ----------------------------------------------------------------- ClassTester ----------------------------------------------------------------- require 'TestClass' ob = TestClass.new() puts("Testing: #{ob.testMethod()}") ----------------------------------------------------------------- Thanks -- Posted via http://www.ruby-forum.com/.