Class: ChatWork::OAuthClient
- Inherits:
-
BaseClient
- Object
- BaseClient
- ChatWork::OAuthClient
- Includes:
- TokenMethods
- Defined in:
- lib/chatwork/oauth_client.rb
Defined Under Namespace
Modules: TokenMethods
Instance Method Summary collapse
-
#initialize(client_id:, client_secret:, api_base: nil) ⇒ OAuthClient
constructor
A new instance of OAuthClient.
Methods included from TokenMethods
Methods inherited from BaseClient
Methods included from Converter
Constructor Details
#initialize(client_id:, client_secret:, api_base: nil) ⇒ OAuthClient
Returns a new instance of OAuthClient.
12 13 14 15 16 |
# File 'lib/chatwork/oauth_client.rb', line 12 def initialize(client_id:, client_secret:, api_base: nil) api_base ||= ChatWork.oauth_api_base signature = Base64.encode64("#{client_id}:#{client_secret}").delete("\n") super(api_base: api_base, header: { "Authorization" => "Basic #{signature}" }) end |