Class: CoreLibrary::Or
- Defined in:
- lib/apimatic-core/authentication/multiple/or_auth_group.rb
Overview
The class to handle the OR combination of multiple authentications for a particular request.
Instance Attribute Summary
Attributes inherited from AuthGroup
#auth_participants, #error_messages, #is_valid_group, #mapped_group
Instance Method Summary collapse
-
#error_message ⇒ String
Getter for the error message for auth.
-
#initialize(*auth_group) ⇒ Or
constructor
A new instance of Or.
-
#valid ⇒ Boolean
Checks if the associated auth is valid.
Methods inherited from AuthGroup
Constructor Details
#initialize(*auth_group) ⇒ Or
Returns a new instance of Or.
10 11 12 13 |
# File 'lib/apimatic-core/authentication/multiple/or_auth_group.rb', line 10 def initialize(*auth_group) super auth_group @is_valid_group = false end |
Instance Method Details
#error_message ⇒ String
Getter for the error message for auth.
6 7 8 |
# File 'lib/apimatic-core/authentication/multiple/or_auth_group.rb', line 6 def @error_messages.join(' or ') end |
#valid ⇒ Boolean
Checks if the associated auth is valid.
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/apimatic-core/authentication/multiple/or_auth_group.rb', line 17 def valid @mapped_group.each do |participant| if participant.valid @is_valid_group = true else @error_messages.append(participant.) end end @is_valid_group end |