Class: OauthTokenVerifier::TokenVerifier

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

Defined Under Namespace

Classes: NoProviderFoundError, TokenCheckError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider_name, token) ⇒ TokenVerifier

Returns a new instance of TokenVerifier.



39
40
41
42
# File 'lib/oauth_token_verifier.rb', line 39

def initialize(provider_name, token)
  @provider = find_provider(provider_name).new
  @token = token
end

Instance Attribute Details

#providerObject

Returns the value of attribute provider.



24
25
26
# File 'lib/oauth_token_verifier.rb', line 24

def provider
  @provider
end

#tokenObject (readonly)

Returns the value of attribute token.



23
24
25
# File 'lib/oauth_token_verifier.rb', line 23

def token
  @token
end

Instance Method Details

#verify_tokenObject



44
45
46
# File 'lib/oauth_token_verifier.rb', line 44

def verify_token
  @provider.verify_token(self)
end