Connecting Tech Pros Worldwide Help | Site Map

creating an array of unique objects

Newbie
 
Join Date: Jan 2007
Posts: 1
#1: Jan 23 '07
Newby question...
When I try to create an array using this method...

value = [1, 2]
buffer = Array.new(10) {value}

I get an array of references to the single instance of "value". But I want an array of unique objects. How should I be specifying this?

Thanks...

(apologies to the other member called "NewGuy" without a space, didn't mean to hijack your name)
Newbie
 
Join Date: Nov 2006
Posts: 14
#2: Jan 26 '07

re: creating an array of unique objects


Quote:

Originally Posted by New Guy

Newby question...
When I try to create an array using this method...

value = [1, 2]
buffer = Array.new(10) {value}

I get an array of references to the single instance of "value". But I want an array of unique objects. How should I be specifying this?

Thanks...

(apologies to the other member called "NewGuy" without a space, didn't mean to hijack your name)




No Problem brother. Sorry I can't help you with your question. I'm new to RUBY too.
Reply