module Yandex::API::Fotki

Constants

API_HOST
VERSION

Public Class Methods

albums() click to toggle source

Fotki::Albums wrapper

@return [Albums]

# File lib/yandex/api/fotki.rb, line 63
def self.albums
  Albums
end
api_urls() click to toggle source

User api urls

@return [Fotki::Me]

# File lib/yandex/api/fotki.rb, line 55
def self.api_urls
  @api_urls
end
oauth(oauth_code) click to toggle source

Main method for authentification

@param [String] oauth_code OAuth code can be recieved here tech.yandex.ru/oauth/doc/dg/reference/web-client-docpage

@return [Fotki] @see tech.yandex.ru/oauth/doc/dg/reference/web-client-docpage/

# File lib/yandex/api/fotki.rb, line 24
def self.oauth(oauth_code)
  return self if !@api_urls.nil? && @oauth_code === oauth_code
  @oauth_code = oauth_code
  me = RestClient.get("#{API_HOST}/api/me/",
                       Fotki.oauth_hash)
  @api_urls = Me.new(me)
  self
end
oauth_code() click to toggle source

Getter for instance variable

@return [String]

# File lib/yandex/api/fotki.rb, line 38
def self.oauth_code
  @oauth_code
end
oauth_hash() click to toggle source

OAuth header for RestClient

@return [Hash]

# File lib/yandex/api/fotki.rb, line 47
def self.oauth_hash
  { 'Authorization' => "OAuth #{Fotki.oauth_code}" }
end
photos() click to toggle source

Fotki::Photos wrapper

@return [Fotki::Photos]

# File lib/yandex/api/fotki.rb, line 71
def self.photos
  Photos
end
xml_to_hash(xml) click to toggle source

XML parser wrapper. Because I'm not sure if it be persistent.

@param [String] xml XML input

@return [Hash] Hash

# File lib/yandex/api/fotki.rb, line 81
def self.xml_to_hash(xml)
  Hash.from_xml(xml)
end