Class: CoreLibrary::HeaderAuth
- Inherits:
-
Authentication
- Object
- Authentication
- CoreLibrary::HeaderAuth
- Defined in:
- lib/apimatic-core/authentication/header_auth.rb
Overview
This class is responsible for adding authentication in request header parameter.
Instance Method Summary collapse
-
#apply(_http_request) ⇒ Object
Applies the authentication scheme on the given HTTP request.
-
#initialize(auth_params) ⇒ HeaderAuth
constructor
A new instance of HeaderAuth.
-
#valid ⇒ Boolean
Checks whether this authentication scheme is valid or not.
Constructor Details
#initialize(auth_params) ⇒ HeaderAuth
Returns a new instance of HeaderAuth.
4 5 6 7 |
# File 'lib/apimatic-core/authentication/header_auth.rb', line 4 def initialize(auth_params) @auth_params = auth_params = nil end |
Instance Method Details
#apply(_http_request) ⇒ Object
Applies the authentication scheme on the given HTTP request.
17 18 19 |
# File 'lib/apimatic-core/authentication/header_auth.rb', line 17 def apply(_http_request) AuthHelper.apply(@auth_params, _http_request.method(:add_header)) end |
#valid ⇒ Boolean
Checks whether this authentication scheme is valid or not.
11 12 13 |
# File 'lib/apimatic-core/authentication/header_auth.rb', line 11 def valid AuthHelper.valid_auth?(@auth_params) end |