Help with ruby/rails script please

Hey,

Here is my code:

flickr_photo_sizes = []

    flickr.photos.getSizes(:photo_id => id).size.each do |flickr_photo_size|
      flickr_photo_sizes << PhotoSize.new({
        :label => flickr_photo_size["label"],
        :source => flickr_photo_size["source"],
        :url => flickr_photo_size["url"]
      })
    end

    photo_sizes = Hash.new

    photo_sizes = flickr_photo_sizes.each do |size|
      { size['label'].to_sym => { size['url'].to_sym => size['url'], size['source'].to_sym => size['source'] } }
    end

    return photo_sizes

I am printing out the photo_sizes hash but it’s not coming out as I expect.

I am after:

{ :small => { :url => ‘this’, :source => ‘this’ }, :medium => { :url => ‘this’, :source => ‘this’ }, :large => { :url => ‘this’, :source => ‘this’ } }

I am still very new to ruby and this is just annoying me as I just can’t seem to get my head around how to create this hash.

Any ideas?

Neil

Anyone able to help me with this?

Could you print flickr_photo_sizes to see the results?