forked from loafle/openapi-generator-original
Removed the singleton design from the Configuration class. Added a `config` field to ApiClient to hold the settings the ApiClient uses.
37 lines
769 B
Plaintext
37 lines
769 B
Plaintext
# Common files
|
|
require '{{gemName}}/api_client'
|
|
require '{{gemName}}/api_error'
|
|
require '{{gemName}}/version'
|
|
require '{{gemName}}/configuration'
|
|
|
|
# Models
|
|
require '{{gemName}}/{{modelPackage}}/base_object'
|
|
{{#models}}
|
|
require '{{importPath}}'
|
|
{{/models}}
|
|
|
|
# APIs
|
|
{{#apiInfo}}
|
|
{{#apis}}
|
|
require '{{importPath}}'
|
|
{{/apis}}
|
|
{{/apiInfo}}
|
|
|
|
module {{moduleName}}
|
|
class << self
|
|
# Customize default settings for the SDK using block.
|
|
# {{moduleName}}.configure do |config|
|
|
# config.username = "xxx"
|
|
# config.password = "xxx"
|
|
# end
|
|
# If no block given, return the default Configuration object.
|
|
def configure
|
|
if block_given?
|
|
yield(Configuration.default)
|
|
else
|
|
Configuration.default
|
|
end
|
|
end
|
|
end
|
|
end
|