Class: Moov::SDKConfiguration
- Inherits:
-
Object
- Object
- Moov::SDKConfiguration
- Extended by:
- T::Sig
- Defined in:
- lib/moov/sdkconfiguration.rb
Overview
Contains the list of servers available to the SDK
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#gen_version ⇒ Object
Returns the value of attribute gen_version.
-
#hooks ⇒ Object
Returns the value of attribute hooks.
-
#language ⇒ Object
Returns the value of attribute language.
-
#openapi_doc_version ⇒ Object
Returns the value of attribute openapi_doc_version.
-
#retry_config ⇒ Object
Returns the value of attribute retry_config.
-
#sdk_version ⇒ Object
Returns the value of attribute sdk_version.
-
#security_source ⇒ Object
Returns the value of attribute security_source.
-
#server_idx ⇒ Object
Returns the value of attribute server_idx.
-
#server_url ⇒ Object
Returns the value of attribute server_url.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
- #get_server_details ⇒ Object
-
#initialize(client, hooks, retry_config, timeout_ms, security, security_source, server_url, server_idx) ⇒ SDKConfiguration
constructor
A new instance of SDKConfiguration.
Constructor Details
#initialize(client, hooks, retry_config, timeout_ms, security, security_source, server_url, server_idx) ⇒ SDKConfiguration
Returns a new instance of SDKConfiguration.
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/moov/sdkconfiguration.rb', line 77 def initialize(client, hooks, retry_config, timeout_ms, security, security_source, server_url, server_idx) @client = client @hooks = hooks @retry_config = retry_config @server_url = server_url @timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil? @server_idx = server_idx.nil? ? 0 : server_idx raise StandardError, "Invalid server index #{server_idx}" if @server_idx.negative? || @server_idx >= SERVERS.length if !security_source.nil? @security_source = security_source elsif !security.nil? @security_source = -> { security } end @language = 'ruby' @openapi_doc_version = 'v2026.04.00' @sdk_version = '26.4.0-dev.12' @gen_version = '2.865.2' @user_agent = 'speakeasy-sdk/ruby 26.4.0-dev.12 2.865.2 v2026.04.00 moov_ruby' end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
26 27 28 |
# File 'lib/moov/sdkconfiguration.rb', line 26 def client @client end |
#gen_version ⇒ Object
Returns the value of attribute gen_version.
60 61 62 |
# File 'lib/moov/sdkconfiguration.rb', line 60 def gen_version @gen_version end |
#hooks ⇒ Object
Returns the value of attribute hooks.
29 30 31 |
# File 'lib/moov/sdkconfiguration.rb', line 29 def hooks @hooks end |
#language ⇒ Object
Returns the value of attribute language.
51 52 53 |
# File 'lib/moov/sdkconfiguration.rb', line 51 def language @language end |
#openapi_doc_version ⇒ Object
Returns the value of attribute openapi_doc_version.
54 55 56 |
# File 'lib/moov/sdkconfiguration.rb', line 54 def openapi_doc_version @openapi_doc_version end |
#retry_config ⇒ Object
Returns the value of attribute retry_config.
32 33 34 |
# File 'lib/moov/sdkconfiguration.rb', line 32 def retry_config @retry_config end |
#sdk_version ⇒ Object
Returns the value of attribute sdk_version.
57 58 59 |
# File 'lib/moov/sdkconfiguration.rb', line 57 def sdk_version @sdk_version end |
#security_source ⇒ Object
Returns the value of attribute security_source.
39 40 41 |
# File 'lib/moov/sdkconfiguration.rb', line 39 def security_source @security_source end |
#server_idx ⇒ Object
Returns the value of attribute server_idx.
47 48 49 |
# File 'lib/moov/sdkconfiguration.rb', line 47 def server_idx @server_idx end |
#server_url ⇒ Object
Returns the value of attribute server_url.
43 44 45 |
# File 'lib/moov/sdkconfiguration.rb', line 43 def server_url @server_url end |
#timeout ⇒ Object
Returns the value of attribute timeout.
35 36 37 |
# File 'lib/moov/sdkconfiguration.rb', line 35 def timeout @timeout end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
63 64 65 |
# File 'lib/moov/sdkconfiguration.rb', line 63 def user_agent @user_agent end |
Instance Method Details
#get_server_details ⇒ Object
98 99 100 101 102 |
# File 'lib/moov/sdkconfiguration.rb', line 98 def get_server_details return [@server_url.delete_suffix('/'), {}] if !@server_url.nil? @server_idx = T.must(@server_idx) [T.must(SERVERS[@server_idx]), {}] end |