Class: RestClientWrapper::Authenticator::Custom
- Inherits:
-
Object
- Object
- RestClientWrapper::Authenticator::Custom
- Includes:
- RestClientWrapper::Auth
- Defined in:
- lib/rest_client_wrapper/authenticators/custom.rb
Overview
Custom
Constant Summary collapse
- TYPE =
%i[header query_param].freeze
Instance Attribute Summary collapse
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #auth_param=(auth_param) ⇒ Object
- #generate_auth ⇒ Object
-
#initialize(**config) ⇒ Custom
constructor
A new instance of Custom.
Constructor Details
#initialize(**config) ⇒ Custom
Returns a new instance of Custom.
35 36 37 38 |
# File 'lib/rest_client_wrapper/authenticators/custom.rb', line 35 def initialize(**config) self.type = config[:type] self.auth_param = config[:auth_param] end |
Instance Attribute Details
#type ⇒ Object
Returns the value of attribute type.
31 32 33 |
# File 'lib/rest_client_wrapper/authenticators/custom.rb', line 31 def type @type end |
Instance Method Details
#auth_param=(auth_param) ⇒ Object
51 52 53 54 55 |
# File 'lib/rest_client_wrapper/authenticators/custom.rb', line 51 def auth_param=(auth_param) raise TypeError, "Request auth_param is not a hash" unless auth_param.is_a?(Hash) @auth_param = auth_param end |
#generate_auth ⇒ Object
40 41 42 |
# File 'lib/rest_client_wrapper/authenticators/custom.rb', line 40 def generate_auth return @auth_param end |