class Yandex::API::Fotki::Photo

Class Photo is wrapper for single photo

@see tech.yandex.ru/fotki/doc/operations-ref/photo-get-docpage/

Attributes

id[R]

Public Class Methods

new(response) click to toggle source

Photo initialize

@param [RestClient::Response] response

# File lib/yandex/api/fotki/photo.rb, line 16
def initialize(response)
  entry = Fotki.xml_to_hash(response)['entry']
  @id = entry['id'].split(':').last.to_i
  @links = entry['img'].map{ |i| { i['size'] => i } }.inject(:merge)
  # puts JSON.pretty_generate(entry)
end