From: Sylvester T Cat Date: 2010-12-10T07:20:26+09:00 Subject: is my instance variable being masked? This is probably trivial for the pros here, but I have a class class MyClass attr_accessor :raw_vehicle_data def parse_raw_vehicle_data @raw_vehicle_data = [0,1,2,3,4] puts raw_vehicle_data.size # => gives proper size of the array (i.e. size > 0) # do other stuff with raw_vehicle_data end end irb(main):019:0> my_class = MyClass.new => # irb(main):020:0> my_class.parse_raw_vehicle_data 5 #<= this value I expect, but it's not assigned to my "instance variable" => nil irb(main):021:0> my_class.raw_vehicle_data.size => nil If I change the line from raw_vehicle_data = [0,1,2,3,4] to @raw_vehicle_data = [0,1,2,3,4], then everything works properly, but I thought attr_accessor gave me access to the function "raw_vehicle_data=" that would assign to an instance variable. Apparently I'm wrong, but not sure why. Thanks!