Hello,
I am trying to do something that on the surface seems easy, but in
practice I don't have a clue how to approach it. I need to create a
multi-dimensional hash to represent certain attributes of a particular
item. When I hardcode the hash for testing purposes it looks something
like this:
@skuList = [{:sku => "XXXX", :price => "$ZZZZ.ZZ"}, {:sku => "YYYY",
:price => "$AAA.AA"}]
However, in production I need to be able to generate an almost exact
same hash dynamically, with the exception of that I don't know how many
objects will need to be inserted into the hash.
Basically, I will be reading in a file that contains an unknown number
of item names and need to return hash that contains the above
attributes for all entries in the file that I just read.
Unfortunately, I am very new to Ruby, and don't have a clue where to
start on something like this.
Can someone help me out?
Thanks,
David
···
--
Posted via http://www.ruby-forum.com/.