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
A new instance of QueryAuth.
-
#valid ⇒ Boolean
Checks whether this authentication scheme is valid or not.
Constructor Details
#initialize(auth_params) ⇒ QueryAuth
Returns a new instance of QueryAuth.
4 5 6 7 |
# File 'lib/apimatic-core/authentication/query_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/query_auth.rb', line 17 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.
11 12 13 |
# File 'lib/apimatic-core/authentication/query_auth.rb', line 11 def valid AuthHelper.valid_auth?(@auth_params) end |