From: Ruby Mania Date: 2012-03-28T14:10:41+09:00 Subject: How to access Class variable? A really stupid question but I am new to OO ruby I created a class ####### class Test attr_accessor :name attr_accessor :category def initialize(name,category) @name=name @category=category end data=[] data << Test.new("Hello","1") data << Test.new("Howdy","2") data.each do |temp| puts temp.inspect end end ######### Output: ------- # # How do I access the the object values. eg: test.name should give Hello and test.category should give 2 Any help is appreciated -- Posted via http://www.ruby-forum.com/.