Class: ESignLive::Client

Inherits:
Object
  • Object
show all
Includes:
API::Calls
Defined in:
lib/esignlive/client.rb

Defined Under Namespace

Classes: EnvironmentError

Constant Summary collapse

VALID_ENVIRONMENTS =
%w(sandbox production)

Constants included from API::Calls

API::Calls::PACKAGE_DEFAULTS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from API::Calls

#authentication_token, #create_package, #create_package_from_template, #get_document, #get_package, #get_packages, #get_role, #get_roles, #get_signing_status, #remove_document_from_package, #send_package, #sender_authentication_token, #signer_authentication_token, #signing_url, #update_role_signer

Constructor Details

#initialize(api_key:, environment: "sandbox") ⇒ Client

Returns a new instance of Client.



12
13
14
15
16
# File 'lib/esignlive/client.rb', line 12

def initialize(api_key:, environment: "sandbox")
  check_environment(environment)
  @headers = create_headers(api_key)
  @environment = environment
end

Instance Attribute Details

#environmentObject (readonly)

Returns the value of attribute environment.



7
8
9
# File 'lib/esignlive/client.rb', line 7

def environment
  @environment
end

#headersObject (readonly)

Returns the value of attribute headers.



7
8
9
# File 'lib/esignlive/client.rb', line 7

def headers
  @headers
end

Instance Method Details

#urlObject



18
19
20
21
22
23
24
25
# File 'lib/esignlive/client.rb', line 18

def url
  if environment == "sandbox"
    "https://sandbox.esignlive.com/api"
  elsif environment == "production"
    "https://apps.esignlive.com/api"
  else
  end
end