how do i access instance variable of one class into other class define in other file in ruby -
i have 1 file named class1.rb 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 not able acess variable @a
in sumit
how do that??
you may have here(adding-an-instance-variable-to-a-class-in-ruby).
Comments
Post a Comment