Class: ApimaticApi::BaseController
- Inherits:
-
Object
- Object
- ApimaticApi::BaseController
- Includes:
- CoreLibrary
- Defined in:
- lib/apimatic_api/controllers/base_controller.rb
Overview
BaseController.
Direct Known Subclasses
ApiValidationExternalApisController, ApiValidationV2ExternalApisController, CodeGenerationExternalApisController, DocsPortalGenerationAsyncController, DocsPortalManagementController, SdkGenerationAsyncController, TransformationController
Constant Summary collapse
- GLOBAL_ERRORS =
{ 'default' => ErrorCase.new .('HTTP response not OK.') .exception_type(APIException) }.freeze
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#http_call_back ⇒ Object
Returns the value of attribute http_call_back.
Instance Method Summary collapse
-
#initialize(global_configuration) ⇒ BaseController
constructor
Initialization constructor.
-
#new_parameter(value, key: nil) ⇒ Parameter
Creates a new instance of the parameter.
-
#new_request_builder(http_method, path, server) ⇒ RequestBuilder
Creates a new instance of the request builder.
-
#new_response_handler ⇒ ResponseHandler
Creates a new instance of the response handler.
Constructor Details
#initialize(global_configuration) ⇒ BaseController
Initialization constructor.
20 21 22 23 24 25 |
# File 'lib/apimatic_api/controllers/base_controller.rb', line 20 def initialize(global_configuration) @global_configuration = global_configuration @config = @global_configuration.client_configuration @http_call_back = @config.http_callback @api_call = ApiCall.new(@global_configuration) end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
10 11 12 |
# File 'lib/apimatic_api/controllers/base_controller.rb', line 10 def config @config end |
#http_call_back ⇒ Object
Returns the value of attribute http_call_back.
10 11 12 |
# File 'lib/apimatic_api/controllers/base_controller.rb', line 10 def http_call_back @http_call_back end |
Instance Method Details
#new_parameter(value, key: nil) ⇒ Parameter
Creates a new instance of the parameter.
49 50 51 52 53 |
# File 'lib/apimatic_api/controllers/base_controller.rb', line 49 def new_parameter(value, key: nil) Parameter.new .key(key) .value(value) end |
#new_request_builder(http_method, path, server) ⇒ RequestBuilder
Creates a new instance of the request builder.
32 33 34 35 36 37 |
# File 'lib/apimatic_api/controllers/base_controller.rb', line 32 def new_request_builder(http_method, path, server) RequestBuilder.new .http_method(http_method) .path(path) .server(server) end |
#new_response_handler ⇒ ResponseHandler
Creates a new instance of the response handler.
41 42 43 |
# File 'lib/apimatic_api/controllers/base_controller.rb', line 41 def new_response_handler ResponseHandler.new end |