From: Chris Morris Date: 2002-10-15T00:53:58+09:00 Subject: Referring to instance vars in a Struct? I have a Struct -- then I extend the class by adding some methods. I expected to be able to access the instance vars, but it seems I can't: D:\temp\rubytest>more struct.rb TestMe = Struct.new('TestMe', :hey) class TestMe def show_hey puts @hey end end test = TestMe.new('hey') p test.hey test.show_hey D:\temp\rubytest>struct "hey" nil D:\temp\rubytest>ruby -v ruby 1.6.6 (2001-12-26) [i586-mswin32] How can I reference the instance vars from inside the class created by Struct.new? Chris http://clabs.org