From: Josh Cheek Date: 2010-10-09T10:27:13+09:00 Subject: Re: how do i add an instance variable to a class in Ruby --001485f626d4e14c6f049225054c Content-Type: text/plain; charset=ISO-8859-1 On Fri, Oct 8, 2010 at 9:12 AM, Amit Tomar wrote: > Hii all , > > > > > I have one file named class1.rb this is structure > > module Person > class Amit > def initialize > @a=10 > end > end > end > another file named class2.rb > > module Person > class Sumit < Amit > def aos > puts "#{@a}" > end > end > end > > i am not access value of @a ,how should i do that > -- > Posted via http://www.ruby-forum.com/. > > Worked for me, are you sure you required the other file? Make sure you have "require File.dirname(__FILE__) + '/a'" at the top (you don't have to make it ugly like this unless you're using 1.9.2) --001485f626d4e14c6f049225054c--