Permalink
Browse files

- share xmlrpc client instance so that cookies are remembered and used

- fix typo in Fotolia::Base#galleries
  • Loading branch information...
1 parent bf84d2a commit ec055ff8e320a1465b1ef7e96c11870ed9a89bfb Torsten Schönebaum committed Jul 15, 2009
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/fotolia/base.rb
View
@@ -31,6 +31,7 @@ def initialize(options = {})
@api_key = options[:api_key]
@language = options[:language] || Fotolia::Language.new(DEFAULT_LANGUAGE)
@api_uri = options[:api_uri] || DEFAULT_API_URI
+ @xmlrpc_client = XMLRPC::Client.new2(@api_uri)
raise ApiKeyRequiredError unless(@api_key)
end
@@ -87,7 +88,7 @@ def countries
# f.galleries.find_all
#
def galleries
- @galleries ||= Fotolia::Galeries.new(self)
+ @galleries ||= Fotolia::Galleries.new(self)
end
#
@@ -183,8 +184,7 @@ def count_media
#
def remote_call(method, *args)
begin
- client = XMLRPC::Client.new2(@api_uri)
- client.call('xmlrpc.' + method.to_s, @api_key, *args)
+ @xmlrpc_client.call('xmlrpc.' + method.to_s, @api_key, *args)
rescue XMLRPC::FaultException => e
raise Fotolia::CommunicationError, e.message
end

0 comments on commit ec055ff

Please sign in to comment.