Class: Flickr::Client

Inherits:
Object
  • Object
show all
Includes:
Authentication, Connection, Requests, Upload
Defined in:
lib/flickr/client.rb,
lib/flickr/client/upload.rb,
lib/flickr/client/requests.rb,
lib/flickr/client/connection.rb,
lib/flickr/client/authentication.rb

Defined Under Namespace

Modules: Authentication, Connection, Requests, Upload

Constant Summary collapse

CONFIGURATION_KEYS =
[
  :consumer_key,
  :consumer_secret,
  :token,
  :token_secret,
  :secure,
  :format,
  :enable_logging,
  :normalize
]

Constants included from Authentication

Authentication::AUTHENTICATION_KEYS

Instance Method Summary collapse

Methods included from Upload

#upload

Methods included from Requests

#delete, #get, #post, #put, #request

Methods included from Connection

#adapter, #connection

Methods included from Authentication

#authentication_options

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



28
29
30
31
32
# File 'lib/flickr/client.rb', line 28

def initialize(options = {})
  CONFIGURATION_KEYS.each do |key|
    send("#{key}=", options[key])
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args) ⇒ Object (protected)



40
41
42
43
# File 'lib/flickr/client.rb', line 40

def method_missing(method_name, *args)
  # super unless ['reflection'].include?(method_name.to_s)      
  args.empty? ? Flickr::Node.new(self, ['flickr', method_name].join('.')) : super
end

Instance Method Details

#endpoint(secure = false) ⇒ Object



34
35
36
# File 'lib/flickr/client.rb', line 34

def endpoint(secure = false)
  secure or self.secure  ? Flickr::SECURE_ENDPOINT : Flickr::DEFAULT_ENDPOINT
end