Class: Docusign::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/docusign/base.rb

Class Method Summary collapse

Class Method Details

.credentials(email, password, endpoint_url = nil) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/docusign/base.rb', line 46

def credentials(email, password, endpoint_url=nil)
  
  connection = Docusign::Credential::CredentialSoap.new
  connection.endpoint_url = endpoint_url if endpoint_url
  
  connection.(:email => email, :password => password).loginResult        
end

.login(options = {}) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/docusign/base.rb', line 20

def (options={})
  
  connection  = Docusign::APIServiceSoap.new
  
  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