Class: OpenX::XmlrpcSessionClient

Inherits:
XmlrpcClient show all
Defined in:
lib/openx/xmlrpc_client.rb

Constant Summary

Constants inherited from XmlrpcClient

OpenX::XmlrpcClient::EXCEPTION_CLASSES

Instance Attribute Summary collapse

Attributes inherited from XmlrpcClient

#client, #url

Instance Method Summary collapse

Constructor Details

#initialize(session) ⇒ XmlrpcSessionClient

Returns a new instance of XmlrpcSessionClient.



54
55
56
57
# File 'lib/openx/xmlrpc_client.rb', line 54

def initialize(session)
  @session = session
  super(session.url)
end

Instance Attribute Details

#sessionObject (readonly)

Returns the value of attribute session.



52
53
54
# File 'lib/openx/xmlrpc_client.rb', line 52

def session
  @session
end

Instance Method Details

#call(method, *args) ⇒ Object



59
60
61
62
63
64
65
66
# File 'lib/openx/xmlrpc_client.rb', line 59

def call(method, *args)
  super
rescue XMLRPC::FaultException => e
  cycle = (cycle || 0) + 1
  raise(e) if cycle > 10 || e.message !~ /Session ID.*invalid/i
  session.recreate!
  retry
end