lib/yoti/configuration.rb in yoti-1.6.4 vs lib/yoti/configuration.rb in yoti-1.7.0
- old
+ new
@@ -1,11 +1,11 @@
module Yoti
class Configuration
attr_accessor :client_sdk_id, :key_file_path, :key, :sdk_identifier,
:api_url, :api_port, :api_version
- attr_writer :api_endpoint
+ attr_writer :api_endpoint, :doc_scan_api_endpoint
# Set config variables by using a configuration block
def initialize
@client_sdk_id = ''
@key_file_path = ''
@@ -16,10 +16,15 @@
@api_version = 'v1'
end
# @return [String] the API endpoint for the selected API version
def api_endpoint
- @api_endpoint ||= "#{@api_url}/api/#{@api_version}"
+ @api_endpoint ||= ENV['YOTI_API_URL'] || "#{@api_url}/api/#{@api_version}"
+ end
+
+ # @return [String] the Doc Scan API endpoint
+ def doc_scan_api_endpoint
+ @doc_scan_api_endpoint ||= ENV['YOTI_DOC_SCAN_API_URL'] || "#{@api_url}/idverify/#{@api_version}"
end
# Validates the configuration values set in instance variables
# @return [nil]
def validate