Class: Yoti::Configuration
- Inherits:
-
Object
- Object
- Yoti::Configuration
- Defined in:
- lib/yoti/configuration.rb
Instance Attribute Summary collapse
-
#api_endpoint ⇒ String
The API endpoint for the selected API version.
-
#api_port ⇒ Object
Returns the value of attribute api_port.
-
#api_url ⇒ Object
Returns the value of attribute api_url.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#client_sdk_id ⇒ Object
Returns the value of attribute client_sdk_id.
-
#doc_scan_api_endpoint ⇒ String
The Doc Scan API endpoint.
-
#key ⇒ Object
Returns the value of attribute key.
-
#key_file_path ⇒ Object
Returns the value of attribute key_file_path.
-
#sdk_identifier ⇒ Object
Returns the value of attribute sdk_identifier.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Set config variables by using a configuration block.
-
#validate ⇒ nil
Validates the configuration values set in instance variables.
Constructor Details
#initialize ⇒ Configuration
Set config variables by using a configuration block
9 10 11 12 13 14 15 16 17 |
# File 'lib/yoti/configuration.rb', line 9 def initialize @client_sdk_id = '' @key_file_path = '' @key = '' @sdk_identifier = 'Ruby' @api_url = 'https://api.yoti.com' @api_port = 443 @api_version = 'v1' end |
Instance Attribute Details
#api_endpoint ⇒ String
Returns the API endpoint for the selected API version.
20 21 22 |
# File 'lib/yoti/configuration.rb', line 20 def api_endpoint @api_endpoint ||= ENV['YOTI_API_URL'] || "#{@api_url}/api/#{@api_version}" end |
#api_port ⇒ Object
Returns the value of attribute api_port.
3 4 5 |
# File 'lib/yoti/configuration.rb', line 3 def api_port @api_port end |
#api_url ⇒ Object
Returns the value of attribute api_url.
3 4 5 |
# File 'lib/yoti/configuration.rb', line 3 def api_url @api_url end |
#api_version ⇒ Object
Returns the value of attribute api_version.
3 4 5 |
# File 'lib/yoti/configuration.rb', line 3 def api_version @api_version end |
#client_sdk_id ⇒ Object
Returns the value of attribute client_sdk_id.
3 4 5 |
# File 'lib/yoti/configuration.rb', line 3 def client_sdk_id @client_sdk_id end |
#doc_scan_api_endpoint ⇒ String
Returns the Doc Scan API endpoint.
25 26 27 |
# File 'lib/yoti/configuration.rb', line 25 def doc_scan_api_endpoint @doc_scan_api_endpoint ||= ENV['YOTI_DOC_SCAN_API_URL'] || "#{@api_url}/idverify/#{@api_version}" end |
#key ⇒ Object
Returns the value of attribute key.
3 4 5 |
# File 'lib/yoti/configuration.rb', line 3 def key @key end |
#key_file_path ⇒ Object
Returns the value of attribute key_file_path.
3 4 5 |
# File 'lib/yoti/configuration.rb', line 3 def key_file_path @key_file_path end |
#sdk_identifier ⇒ Object
Returns the value of attribute sdk_identifier.
3 4 5 |
# File 'lib/yoti/configuration.rb', line 3 def sdk_identifier @sdk_identifier end |
Instance Method Details
#validate ⇒ nil
Validates the configuration values set in instance variables
31 32 33 34 35 |
# File 'lib/yoti/configuration.rb', line 31 def validate validate_required_all(%w[client_sdk_id]) validate_required_any(%w[key_file_path key]) validate_value('api_version', ['v1']) end |