class Docusign::Base

Public Class Methods

configure_ssl(connection) click to toggle source
# File lib/docusign/base.rb, line 57
def configure_ssl(connection)
  connection.options["protocol.http.ssl_config.verify_mode"] = Docusign::Config[:verify_mode] if Docusign::Config[:verify_mode]
                          connection.options["protocol.http.ssl_config.ca_file"] = Docusign::Config[:ca_file] if Docusign::Config[:ca_file]
                          connection
end
credentials(email, password, endpoint_url=nil) click to toggle source
# File lib/docusign/base.rb, line 47
def credentials(email, password, endpoint_url=nil)
  
  connection = Docusign::Credential::CredentialSoap.new
  connection = configure_ssl(connection)
  
  connection.endpoint_url = endpoint_url if endpoint_url
  
  connection.login(:email => email, :password => password).loginResult        
end
login(options={}) click to toggle source
# File lib/docusign/base.rb, line 20
def login(options={})
  
  connection  = Docusign::APIServiceSoap.new
  connection = configure_ssl(connection)
  
  if options[:integrators_key]
    header = IntegratorsKeyAuthHeaderHandler.new(
      :email           => options.delete(:email),
      :integrators_key => options.delete(:integrators_key),
      :password        => options.delete(:password)
    )
  else
    header = AuthHeaderHandler.new(
      :user_name => options.delete(:user_name), 
      :password  => options.delete(:password)
    )
  end
  
  connection.headerhandler << header
  
  options.each do |key, value|
    connection.send("#{key}=", value)
  end
  
  connection
end