From: Jonathan Allen Date: 2010-08-30T22:21:11+09:00 Subject: Pass an array to a new instance of a class. I am having trouble passing values to an array of a new instance of the class Item that I have created. The following codse does not fille the flags array with the value 'container'. class Item attr_accessor :inum, :name, :description, :slot, :flags, :items def initialize( inum, name, description, slot, flags, items ) @inum = inum @name = name @description = description @slot = slot @flags = [] @items = [] end def is_container return true if flags.include?(container) end end Item.new("0007", "crate", "A large crate.\r\n", ":none", "container", "") However when I use the code below, I am able to add the value 'container' to the flags array. $rooms[("0001")].item("crate").flags << "container" My question is, how do I modify the first bit of code to allow passing values to the array of the new instance of the class Item? -- Posted via http://www.ruby-forum.com/.