Class: ReportingSettlementResearchApi::CustomHeaderAuthenticationCredentials
- Inherits:
-
Object
- Object
- ReportingSettlementResearchApi::CustomHeaderAuthenticationCredentials
- Defined in:
- lib/reporting_settlement_research_api/http/auth/custom_header_authentication.rb
Overview
Data class for CustomHeaderAuthenticationCredentials. Data class for CustomHeaderAuthenticationCredentials.
Instance Attribute Summary collapse
-
#authorization ⇒ Object
readonly
Returns the value of attribute authorization.
Class Method Summary collapse
Instance Method Summary collapse
- #clone_with(authorization: nil) ⇒ Object
-
#initialize(authorization:) ⇒ CustomHeaderAuthenticationCredentials
constructor
A new instance of CustomHeaderAuthenticationCredentials.
Constructor Details
#initialize(authorization:) ⇒ CustomHeaderAuthenticationCredentials
Returns a new instance of CustomHeaderAuthenticationCredentials.
30 31 32 33 34 |
# File 'lib/reporting_settlement_research_api/http/auth/custom_header_authentication.rb', line 30 def initialize(authorization:) raise ArgumentError, 'authorization cannot be nil' if .nil? = end |
Instance Attribute Details
#authorization ⇒ Object (readonly)
Returns the value of attribute authorization.
28 29 30 |
# File 'lib/reporting_settlement_research_api/http/auth/custom_header_authentication.rb', line 28 def end |
Class Method Details
.from_env ⇒ Object
36 37 38 39 40 41 42 43 44 |
# File 'lib/reporting_settlement_research_api/http/auth/custom_header_authentication.rb', line 36 def self.from_env = ENV['AUTHORIZATION'] all_nil = [ ].all?(&:nil?) return nil if all_nil new(authorization: ) end |
Instance Method Details
#clone_with(authorization: nil) ⇒ Object
46 47 48 49 50 |
# File 'lib/reporting_settlement_research_api/http/auth/custom_header_authentication.rb', line 46 def clone_with(authorization: nil) ||= self. CustomHeaderAuthenticationCredentials.new(authorization: ) end |