How do I refer to my objects' keys in a Hash? The following snippet
demonstrates my problem ...

Thanks

Chris

------------------------------------------------------------------
class Company
	def initialize(name)
		@name = name
	end

	def to_s
		sprintf("Company(%s)", @name)
	end

	def hash
		@name
	end
end

abc = Company.new("ABC")
xyz = Company.new("XYZ")
portfolio = Hash.new
portfolio[abc] = 10.0
portfolio[xyz] = 15.0
portfolio.keys.each do |each|
	printf("%s is worth %s\n", each, portfolio[each].to_s)
end
puts portfolio

------------------------------------------------------------------
produces ...

[chrisr ~/Que/src]$ ruby HashTest.rb
Company(XYZ) is worth
Company(ABC) is worth
Company(XYZ)15.0Company(ABC)10.0
[chrisr ~/Que/src]$

------------------------------------------------------------------