Module: Flickr::Configuration
- Included in:
- Flickr
- Defined in:
- lib/flickr/configuration.rb
Overview
Provides general configuration options for the library.
Instance Attribute Summary collapse
-
#access_token_key ⇒ Object
Required for authenticated requests.
-
#access_token_secret ⇒ Object
Required for authenticated requests.
-
#api_key ⇒ Object
API key and shared secret are necessary for making API requests.
-
#cache ⇒ Object
Enables caching responses.
-
#open_timeout ⇒ Object
Time to wait for the connection to Flickr to open.
-
#pagination ⇒ Object
When retrieving photos from Flickr, you can enable automatic compatibility with a pagination library.
-
#proxy ⇒ Object
You can choose to go over a proxy.
-
#shared_secret ⇒ Object
API key and shared secret are necessary for making API requests.
-
#timeout ⇒ Object
Time to wait for the first block of response from Flickr.
-
#use_ssl ⇒ Object
You can choose to make requests over a secure connection (SSL).
Instance Method Summary collapse
Instance Attribute Details
#access_token_key ⇒ Object
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 OAuth module.
37 38 39 |
# File 'lib/flickr/configuration.rb', line 37 def access_token_key @access_token_key end |
#access_token_secret ⇒ Object
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 OAuth module.
37 38 39 |
# File 'lib/flickr/configuration.rb', line 37 def access_token_secret @access_token_secret end |
#api_key ⇒ Object
API key and shared secret are necessary for making API requests. You can apply for them here.
27 28 29 |
# File 'lib/flickr/configuration.rb', line 27 def api_key @api_key end |
#cache ⇒ Object
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)
96 97 98 |
# File 'lib/flickr/configuration.rb', line 96 def cache @cache end |
#open_timeout ⇒ Object
Time to wait for the connection to Flickr to open. After that TimeoutError is thrown.
53 54 55 |
# File 'lib/flickr/configuration.rb', line 53 def open_timeout @open_timeout end |
#pagination ⇒ Object
When retrieving photos from Flickr, you can enable automatic compatibility with a pagination library.
config.pagination = :will_paginate
Supports WillPaginate and Kaminari.
88 89 90 |
# File 'lib/flickr/configuration.rb', line 88 def pagination @pagination end |
#proxy ⇒ Object
You can choose to go over a proxy.
config.proxy = "http://proxy.com"
75 76 77 |
# File 'lib/flickr/configuration.rb', line 75 def proxy @proxy end |
#shared_secret ⇒ Object
API key and shared secret are necessary for making API requests. You can apply for them here.
27 28 29 |
# File 'lib/flickr/configuration.rb', line 27 def shared_secret @shared_secret end |
#timeout ⇒ Object
Time to wait for the first block of response from Flickr. After that TimeoutError is thrown.
58 59 60 |
# File 'lib/flickr/configuration.rb', line 58 def timeout @timeout end |
#use_ssl ⇒ Object
You can choose to make requests over a secure connection (SSL).
config.use_ssl = true
Default is false
.
67 68 69 |
# File 'lib/flickr/configuration.rb', line 67 def use_ssl @use_ssl end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
16 17 18 19 |
# File 'lib/flickr/configuration.rb', line 16 def configure yield self self end |