Method: Fotolia::Base#initialize
- Defined in:
- lib/fotolia/base.rb
#initialize(options = {}) ⇒ Base
options hash
- :api_key <String>
-
Your Fotolia API key (an exception is raised if not included)
- :language <Fotolia::Language>
-
The language the client should submit to the API if applicable. Defaults to Fotolia::Language.new(DEFAULT_LANGUAGE).
- :api_uri <String>
-
The URI of the Fotolia API. Defaults to DEFAULT_API_URI.
121 122 123 124 125 126 127 128 |
# File 'lib/fotolia/base.rb', line 121 def initialize( = {}) @api_key = [:api_key] @language = [:language] || Fotolia::Language.new(DEFAULT_LANGUAGE) @api_uri = [:api_uri] || DEFAULT_API_URI @xmlrpc_client = XMLRPC::Client.new2(@api_uri) raise ApiKeyRequiredError unless(@api_key) end |