Class: UntitledApi::CustomHeaderAuthenticationCredentials

Inherits:
Object
  • Object
show all
Defined in:
lib/untitled_api/http/auth/custom_header_authentication.rb

Overview

Data class for CustomHeaderAuthenticationCredentials. Data class for CustomHeaderAuthenticationCredentials.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(authorization:) ⇒ CustomHeaderAuthenticationCredentials

Returns a new instance of CustomHeaderAuthenticationCredentials.

Raises:

  • (ArgumentError)


30
31
32
33
34
# File 'lib/untitled_api/http/auth/custom_header_authentication.rb', line 30

def initialize(authorization:)
  raise ArgumentError, 'authorization cannot be nil' if authorization.nil?

  @authorization = authorization
end

Instance Attribute Details

#authorizationObject (readonly)

Returns the value of attribute authorization.



28
29
30
# File 'lib/untitled_api/http/auth/custom_header_authentication.rb', line 28

def authorization
  @authorization
end

Instance Method Details

#clone_with(authorization: nil) ⇒ Object



36
37
38
39
40
# File 'lib/untitled_api/http/auth/custom_header_authentication.rb', line 36

def clone_with(authorization: nil)
  authorization ||= self.authorization

  CustomHeaderAuthenticationCredentials.new(authorization: authorization)
end