Class: Idnow::Client
- Inherits:
-
Object
- Object
- Idnow::Client
- Includes:
- API::Authentication, API::AutomatedTesting, API::DocumentDefinitions, API::DownloadDocuments, API::RequestIdentifications, API::RetrieveIdentifications, API::UploadDocuments
- Defined in:
- lib/idnow/client.rb
Constant Summary collapse
- API_VERSION =
'v1'.freeze
Constants included from API::AutomatedTesting
Constants included from API::RetrieveIdentifications
API::RetrieveIdentifications::IDENTIFICATION_STATUSES
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
Instance Method Summary collapse
-
#initialize(env:, company_id:, api_key:) ⇒ Client
constructor
A new instance of Client.
Methods included from API::DownloadDocuments
Methods included from API::UploadDocuments
#upload_default_document, #upload_identification_document
Methods included from API::DocumentDefinitions
#create_document_definition, #list_cached_document_definitions, #list_document_definitions
Methods included from API::AutomatedTesting
#testing_request_video_chat, #testing_start
Methods included from API::RequestIdentifications
Methods included from API::RetrieveIdentifications
#download_identification, #get_identification, #list_identifications
Methods included from API::Authentication
Constructor Details
#initialize(env:, company_id:, api_key:) ⇒ Client
Returns a new instance of Client.
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/idnow/client.rb', line 23 def initialize(env:, company_id:, api_key:) fail 'Please set env to :test or :live' unless Idnow::ENVIRONMENTS.keys.include?(env) fail 'Please set your company_id' if company_id.nil? fail 'Please set your api_key' if api_key.nil? @host = Idnow::ENVIRONMENTS[env][:host] @target_host = Idnow::ENVIRONMENTS[env][:target_host] @company_id = company_id @api_key = api_key @http_client = HttpClient.new(host: @host) @sftp_client = SftpClient.new(host: @host, username: @company_id, password: @api_key) end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
21 22 23 |
# File 'lib/idnow/client.rb', line 21 def host @host end |