class ImageCollage::ResponseParser

Constants

PHOTO_PATH

Public Class Methods

new(response) click to toggle source
# File lib/imagecollage/flickr_api.rb, line 42
def initialize(response)
  @response = response # TODO Wrap in a Hash if needed
end

Public Instance Methods

fetch(key) click to toggle source
# File lib/imagecollage/flickr_api.rb, line 46
def fetch(key)
  photo_data[key]
end
photo_data() click to toggle source
# File lib/imagecollage/flickr_api.rb, line 50
def photo_data
  @_photo_data ||= PHOTO_PATH.reduce(@response) do |subdata, el|
    break unless subdata
    subdata[el]
  end

  @_photo_data || {}
end