Class: RestClientWrapper::Authenticator::Custom

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(type:, auth_param:) ⇒ Custom

Returns a new instance of Custom.



35
36
37
38
# File 'lib/rest_client_wrapper/authenticators/custom.rb', line 35

def initialize(type:, auth_param:)
  self.type = type
  self.auth_param = auth_param
end

Instance Attribute Details

#typeObject

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

Raises:

  • (TypeError)


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_authObject



40
41
42
# File 'lib/rest_client_wrapper/authenticators/custom.rb', line 40

def generate_auth
  return @auth_param
end