Class: Verizon::BaseController
- Inherits:
-
Object
- Object
- Verizon::BaseController
- Includes:
- CoreLibrary
- Defined in:
- lib/verizon/controllers/base_controller.rb
Overview
BaseController.
Direct Known Subclasses
APIController, AccountDevicesController, AccountRequestsController, AccountServiceController, AccountSubscriptionsController, AccountsController, AnomalySettingsController, AnomalyTriggersController, AnomalyTriggersV2Controller, BillingController, CampaignsV2Controller, CampaignsV3Controller, ClientLoggingController, CloudConnectorDevicesController, CloudConnectorSubscriptionsController, ConfigurationFilesController, ConnectivityCallbacksController, CreatePricePlanTriggersController, DeviceActionsController, DeviceCredentialManagementController, DeviceDiagnosticsController, DeviceGroupsController, DeviceLocationCallbacksController, DeviceManagementController, DeviceMonitoringController, DeviceProfileManagementController, DeviceReportsController, DeviceRoleController, DeviceSMSMessagingController, DeviceServiceManagementController, DevicesLocationSubscriptionsController, DevicesLocationsController, DiagnosticsCallbacksController, DiagnosticsFactoryResetController, DiagnosticsHistoryController, DiagnosticsObservationsController, DiagnosticsSettingsController, DiagnosticsSubscriptionsController, EUICCDeviceProfileManagementController, ExclusionsController, FirmwareV1Controller, FirmwareV3Controller, GlobalReportingController, HPLDeviceManagementController, HyperPreciseLocationCallbacksController, IntelligenceServiceController, M5gBIDeviceActionsController, ManagingESIMProfilesController, MapDataManagerController, OauthAuthorizationController, PWNController, PromotionPeriodInformationController, RetrieveRatePlanListController, RetrieveTheTriggersController, SIMActionsController, SIMSecureForIoTLicensesController, SMSController, SensorInsightsDeviceProfileController, SensorInsightsDevicesController, SensorInsightsGatewaysController, SensorInsightsHealthScoreController, SensorInsightsNotificationGroupsController, SensorInsightsRulesController, SensorInsightsSensorsController, SensorInsightsSmartAlertMetricsController, SensorInsightsSmartAlertsController, SensorInsightsUsersController, ServerLoggingController, ServicePlansController, SessionManagementController, SoftwareManagementCallbacksV1Controller, SoftwareManagementCallbacksV2Controller, SoftwareManagementCallbacksV3Controller, SoftwareManagementLicensesV1Controller, SoftwareManagementLicensesV2Controller, SoftwareManagementLicensesV3Controller, SoftwareManagementReportsV1Controller, SoftwareManagementReportsV2Controller, SoftwareManagementReportsV3Controller, SoftwareManagementSubscriptionsV1Controller, SoftwareManagementSubscriptionsV2Controller, SoftwareManagementSubscriptionsV3Controller, TargetsController, ThingSpaceQualityOfServiceAPIActionsController, UpdatePricePlanTriggersController, UpdateTriggersController, UsageTriggerManagementController, WirelessNetworkPerformanceController
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.
Class Method Summary collapse
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.
25 26 27 28 29 30 |
# File 'lib/verizon/controllers/base_controller.rb', line 25 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/verizon/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/verizon/controllers/base_controller.rb', line 10 def http_call_back @http_call_back end |
Class Method Details
.user_agent ⇒ Object
12 13 14 |
# File 'lib/verizon/controllers/base_controller.rb', line 12 def self.user_agent 'APIMATIC 3.0' end |
Instance Method Details
#new_parameter(value, key: nil) ⇒ Parameter
Creates a new instance of the parameter.
54 55 56 57 58 |
# File 'lib/verizon/controllers/base_controller.rb', line 54 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.
37 38 39 40 41 42 |
# File 'lib/verizon/controllers/base_controller.rb', line 37 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.
46 47 48 |
# File 'lib/verizon/controllers/base_controller.rb', line 46 def new_response_handler ResponseHandler.new end |