Class: SlackWebApi::BaseController
- Inherits:
-
Object
- Object
- SlackWebApi::BaseController
- Includes:
- CoreLibrary
- Defined in:
- lib/slack_web_api/controllers/base_controller.rb
Overview
BaseController.
Direct Known Subclasses
AdminAppsApprovedController, AdminAppsController, AdminAppsRequestsController, AdminAppsRestrictedController, AdminConversationsController, AdminConversationsEkmController, AdminConversationsRestrictAccessController, AdminEmojiController, AdminInviteRequestsApprovedController, AdminInviteRequestsController, AdminInviteRequestsDeniedController, AdminTeamsAdminsController, AdminTeamsController, AdminTeamsOwnersController, AdminTeamsSettingsController, AdminUsergroupsController, AdminUsersController, AdminUsersSessionController, ApiController, AppsController, AppsEventAuthorizationsController, AppsPermissionsController, AppsPermissionsResourcesController, AppsPermissionsScopesController, AppsPermissionsUsersController, AuthController, BotsController, CallsController, CallsParticipantsController, ChatController, ChatScheduledMessagesController, ConversationsController, DialogController, DndController, EmojiController, FilesCommentsController, FilesController, FilesRemoteController, MigrationController, OauthAuthorizationController, OauthController, OauthV2Controller, PinsController, ReactionsController, RemindersController, RtmController, SearchController, StarsController, TeamController, TeamProfileController, UsergroupsController, UsergroupsUsersController, UsersController, UsersProfileController, ViewsController, WorkflowsController
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.
32 33 34 35 36 37 |
# File 'lib/slack_web_api/controllers/base_controller.rb', line 32 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/slack_web_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/slack_web_api/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/slack_web_api/controllers/base_controller.rb', line 12 def self.user_agent 'Ruby-SDK/1.0.1 [OS: {os-info}, Engine: {engine}/{engine-version}]' end |
.user_agent_parameters ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/slack_web_api/controllers/base_controller.rb', line 16 def self.user_agent_parameters { '{engine}' => { 'value' => RUBY_ENGINE, 'encode' => false }, '{engine-version}' => { 'value' => RUBY_ENGINE_VERSION, 'encode' => false }, '{os-info}' => { 'value' => RUBY_PLATFORM, 'encode' => false } } end |
Instance Method Details
#new_parameter(value, key: nil) ⇒ Parameter
Creates a new instance of the parameter.
61 62 63 64 65 |
# File 'lib/slack_web_api/controllers/base_controller.rb', line 61 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.
44 45 46 47 48 49 |
# File 'lib/slack_web_api/controllers/base_controller.rb', line 44 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.
53 54 55 |
# File 'lib/slack_web_api/controllers/base_controller.rb', line 53 def new_response_handler ResponseHandler.new end |