Class: PermitBaseApi
- Inherits:
-
Object
- Object
- PermitBaseApi
- Defined in:
- lib/api/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#config ⇒ Object
Returns the value of attribute config.
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
-
#initialize(client, config, logger) ⇒ PermitBaseApi
constructor
A new instance of PermitBaseApi.
- #lazy_load_context ⇒ Object
Constructor Details
#initialize(client, config, logger) ⇒ PermitBaseApi
Returns a new instance of PermitBaseApi.
20 21 22 23 24 |
# File 'lib/api/base.rb', line 20 def initialize(client, config, logger) @logger = logger @config = config @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
3 4 5 |
# File 'lib/api/base.rb', line 3 def client @client end |
#config ⇒ Object
Returns the value of attribute config.
3 4 5 |
# File 'lib/api/base.rb', line 3 def config @config end |
#logger ⇒ Object
Returns the value of attribute logger.
3 4 5 |
# File 'lib/api/base.rb', line 3 def logger @logger end |
Instance Method Details
#lazy_load_context ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/api/base.rb', line 5 def lazy_load_context # If the instance config context is nil, we need to load it from the server OpenapiClient.configure do |openapi_config| openapi_config.scheme = Utils.get_schema_from_url(config.api_url) openapi_config.host = Utils.get_host_from_url(config.api_url) openapi_config.access_token = config.token openapi_config.server_operation_index = {} openapi_config.server_index = nil end client = OpenapiClient::APIKeysApi.new if @config.context.nil? @config.context = client.get_api_key_scope end end |