From: Markus Schirp Date: 2007-11-04T13:21:54+09:00 Subject: Re: How do I make variables defined in a method accessible on another method? Am Sun, 4 Nov 2007 12:51:19 +0900 schrieb "Victor Reyes" : > class My_Class > > def init_method(size) > arr = Array.new(size) > index = 1 > end # End method > > def print_method > p arr > p index > end # End method > > end # End class > > my_obj = My_Class.new() > my_obj.init_method 10 > my_obj.print_method Use instance variables! class Example def init(size) # why u arent using initialize? @arr = Array.new @index = -1 end def print_method p @arr p @index end end # class Example