Module: Flickr::Proxy::ClassMethods

Defined in:
lib/simple-flickr/proxy.rb

Overview

Class methods.

Instance Method Summary collapse

Instance Method Details

#api_query(api_method, client, options = {}) ⇒ Object

Find objects using a Flickr API method, a Flickr::Client and a hash of options.

this is mostly intended for internal use, but can also be used to directly call specific api methods.

Parameters

:client<Flickr::Client>

Instance of a Flickr::Client to use to make the request.

:api_method<String>

The Flickr API method to use. Must return nodes matching the class this is called on. (example, ‘photosets’ for Flickr::PhotoSet)

:options<Hash>

Options to be passed along to the Flickr API Method.

Returns

Array

An Array of Flickr::Photo objects.



59
60
61
# File 'lib/simple-flickr/proxy.rb', line 59

def api_query(api_method, client, options = {} ) 
  client.request( api_method, options ).search( self.to_s.gsub('Flickr::','').downcase ).collect { |xml| new( xml, client ) }
end