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