I have an array of hashes, which I would rather be turned into an array of objects with attributes programmatically added to those objects.
I'm try this at the moment
obj = OpenStruct.new
resulthash["users"].collect { |u|
u.each do |k,v|
obj.send("#{k}=#{v}");
end
}
To recap I'm trying to do
obj.foo = "bar"
obj.hello = "world"
But programmatically if for example to the array/hash looked liked this
{"users"=>[{"foo"=>"bar","hello"=>"world"}]}