From: ujihisa@... Date: 2007-10-15T12:37:28+09:00 Subject: Re: I need some help plz with my ruby project. class Student attr_accessor :courses def initialize(hash = {}) @name = hash[:name] @id = hash[:id] @courses = [] # if you need, write on some validations here. end end class Course def initialize(hash = {}) @code = hash[:name] @name = hash[:id] @grade = hash[:grade] # if you need, write on some validations here. end end s1 = Student.new :name => "Eric", :code => "00101" s1.courses << Course.new(:code => "22c:021", :name => "Computer Science I", :grade =>"B-") p s1.courses.map {|c| c[:grade] }