Class: DingSDK::SDKConfiguration
- Inherits:
-
Utils::FieldAugmented
- Object
- Utils::FieldAugmented
- DingSDK::SDKConfiguration
- Extended by:
- T::Sig
- Defined in:
- lib/ding_sdk/sdkconfiguration.rb
Overview
Contains the list of servers available to the SDK
Instance Method Summary collapse
- #get_server_details ⇒ Object
-
#initialize(client, security, server_url, server_idx) ⇒ SDKConfiguration
constructor
A new instance of SDKConfiguration.
Methods included from MetadataFields
#field, #fields, included, #marshal_json, #marshal_single
Constructor Details
#initialize(client, security, server_url, server_idx) ⇒ SDKConfiguration
Returns a new instance of SDKConfiguration.
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/ding_sdk/sdkconfiguration.rb', line 33 def initialize(client, security, server_url, server_idx) @client = client @server_url = server_url @server_idx = server_idx.nil? ? 0 : server_idx raise StandardError, "Invalid server index #{server_idx}" if @server_idx.negative? || @server_idx >= SERVERS.length @security = security @language = 'ruby' @openapi_doc_version = '1.0.0' @sdk_version = '0.8.19' @gen_version = '2.426.2' @user_agent = 'speakeasy-sdk/ruby 0.8.19 2.426.2 1.0.0 ding_sdk' end |
Instance Method Details
#get_server_details ⇒ Object
47 48 49 50 |
# File 'lib/ding_sdk/sdkconfiguration.rb', line 47 def get_server_details return [@server_url.delete_suffix('/'), {}] if !@server_url.nil? [SERVERS[@server_idx], {}] end |