Class: CoreLibrary::QueryAuth
- Inherits:
-
Authentication
- Object
- Authentication
- CoreLibrary::QueryAuth
- Defined in:
- lib/apimatic-core/authentication/query_auth.rb
Overview
This class is responsible for adding authentication in request query parameter.
Instance Method Summary collapse
-
#apply(_http_request) ⇒ Object
Applies the authentication scheme on the given HTTP request.
-
#initialize(auth_params) ⇒ QueryAuth
constructor
Initializes a new instance of QueryAuth.
-
#valid ⇒ Boolean
Checks whether this authentication scheme is valid or not.
Constructor Details
#initialize(auth_params) ⇒ QueryAuth
Initializes a new instance of QueryAuth.
6 7 8 9 |
# File 'lib/apimatic-core/authentication/query_auth.rb', line 6 def initialize(auth_params) @auth_params = auth_params @error_message = nil end |
Instance Method Details
#apply(_http_request) ⇒ Object
Applies the authentication scheme on the given HTTP request.
19 20 21 |
# File 'lib/apimatic-core/authentication/query_auth.rb', line 19 def apply(_http_request) AuthHelper.apply(@auth_params, _http_request.method(:add_query_parameter)) end |
#valid ⇒ Boolean
Checks whether this authentication scheme is valid or not.
13 14 15 |
# File 'lib/apimatic-core/authentication/query_auth.rb', line 13 def valid AuthHelper.valid_auth?(@auth_params) end |