lib/greygoo/role/container.rb
# some things have more than one container, eg. room has objects and
# players. so default to objects and initialize the instance variable
some things have more than one container, eg. room has objects and
players. so default to objects and initialize the instance variable
some things have more than one container eg . room has objects and players . so default to objects and initialize the instance variable
def objs(sym = :@objects)
				if !instance_variables.include?(sym)
					return instance_variable_set(sym, Set.new)
				end
				if self.respond_to?(sym[1..-1])
					return self.send(sym[1..-1])
				end
				instance_variable_get(sym)
			end
def objs ( sym = :@objects ) if ! instance_variables . include? ( sym ) return instance_variable_set ( sym , Set . new ) end if self . respond_to? ( sym [ 1 .. - 1 ] ) return self . send ( sym [ 1 .. - 1 ] ) end instance_variable_get ( sym ) end
some things have more than one container, eg.
some things have more than one container eg .
# bit of a hack.. try the accessor first in case it's lazily # initialized # but otherwise just use our instance variable this would be cleaner # if we could guarantee that all objects had accessors, then we could # just use the thing above. but it doesn't seem right to declare # accessors in the consuming class *and* use the role.
sym