creating an array of unique objects

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • New Guy
    New Member
    • Jan 2007
    • 1

    creating an array of unique objects

    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)
  • NewGuy
    New Member
    • Nov 2006
    • 14

    #2
    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.

    Comment

    Working...