Class: ESignLive::Client
- Inherits:
-
Object
- Object
- ESignLive::Client
- 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
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
Instance Method Summary collapse
-
#initialize(api_key:, environment: "sandbox") ⇒ Client
constructor
A new instance of Client.
- #url ⇒ Object
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
#environment ⇒ Object (readonly)
Returns the value of attribute environment.
7 8 9 |
# File 'lib/esignlive/client.rb', line 7 def environment @environment end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
7 8 9 |
# File 'lib/esignlive/client.rb', line 7 def headers @headers end |
Instance Method Details
#url ⇒ Object
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 |