Class: PkceOauth::Comparison
- Inherits:
-
Object
- Object
- PkceOauth::Comparison
- Defined in:
- lib/pkce_oauth/comparison.rb
Instance Attribute Summary collapse
-
#challenger ⇒ Object
readonly
Returns the value of attribute challenger.
Instance Method Summary collapse
- #equal?(code_verifier:, code_challenge:) ⇒ Boolean
-
#initialize(challenger: CodeChallenger) ⇒ Comparison
constructor
A new instance of Comparison.
Constructor Details
#initialize(challenger: CodeChallenger) ⇒ Comparison
Returns a new instance of Comparison.
7 8 9 |
# File 'lib/pkce_oauth/comparison.rb', line 7 def initialize(challenger: CodeChallenger) @challenger = challenger.new end |
Instance Attribute Details
#challenger ⇒ Object (readonly)
Returns the value of attribute challenger.
5 6 7 |
# File 'lib/pkce_oauth/comparison.rb', line 5 def challenger @challenger end |
Instance Method Details
#equal?(code_verifier:, code_challenge:) ⇒ Boolean
11 12 13 |
# File 'lib/pkce_oauth/comparison.rb', line 11 def equal?(code_verifier:, code_challenge:) challenger.call(code_verifier: code_verifier) == code_challenge end |