Class: PkceOauth::Comparison

Inherits:
Object
  • Object
show all
Defined in:
lib/pkce_oauth/comparison.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#challengerObject (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

Returns:



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