module Flickr::Configuration

Provides general configuration options for the library.

Attributes

access_token_key[RW]

Required for authenticated requests.

config.access_token_key    = "KEY"
config.access_token_secret = "SECRET"

For details on how to obtain it, take a look at the {Flickr::OAuth} module.

access_token_secret[RW]

Required for authenticated requests.

config.access_token_key    = "KEY"
config.access_token_secret = "SECRET"

For details on how to obtain it, take a look at the {Flickr::OAuth} module.

api_key[RW]

API key and shared secret are necessary for making API requests. You can apply for them [here].

[api_key]: www.flickr.com/services/apps/create/apply

cache[RW]

Enables caching responses. An object that is passed must respond to ‘#read`, `#write` and `#fetch`.

config.cache = ActiveSupport::Cache::MemoryStore.new(expires_in: 1.hour)
open_timeout[RW]

Time to wait for the connection to Flickr to open. After that {Flickr::TimeoutError} is thrown.

pagination[RW]

When retrieving photos from Flickr, you can enable automatic compatibility with a pagination library.

config.pagination = :will_paginate

Supports [WillPaginate] and [Kaminari].

[will_paginate]: github.com/mislav/will_paginate [kaminari]: github.com/amatsuda/kaminari

proxy[RW]

You can choose to go over a proxy.

config.proxy = "http://proxy.com"
secure=[RW]

You can choose to make requests over a secure connection (SSL).

config.use_ssl = true

Default is ‘false`.

shared_secret[RW]

API key and shared secret are necessary for making API requests. You can apply for them [here].

[api_key]: www.flickr.com/services/apps/create/apply

timeout[RW]

Time to wait for the first block of response from Flickr. After that {Flickr::TimeoutError} is thrown.

use_ssl[RW]

You can choose to make requests over a secure connection (SSL).

config.use_ssl = true

Default is ‘false`.

Public Instance Methods

access_token() click to toggle source

@return [Array(string, string)] @private

# File lib/flickr/configuration.rb, line 43
def access_token
  if access_token_key and access_token_secret
    [access_token_key, access_token_secret]
  end
end
configure() { |self| ... } click to toggle source

@example

Flickr.configure do |config|
  config.api_key = "..."
  config.shared_secret = "..."
  # ...
end
# File lib/flickr/configuration.rb, line 16
def configure
  yield self
  self
end