Class: OAuth2c::Cache::Manager::CacheProxy

Inherits:
BasicObject
Defined in:
lib/oauth2c/cache/manager.rb

Instance Method Summary collapse

Constructor Details

#initialize(cache, key, grant) ⇒ CacheProxy

Returns a new instance of CacheProxy.



56
57
58
59
60
# File 'lib/oauth2c/cache/manager.rb', line 56

def initialize(cache, key, grant)
  @cache = cache
  @key   = key
  @grant = grant
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



62
63
64
# File 'lib/oauth2c/cache/manager.rb', line 62

def method_missing(name, *args)
  @grant.public_send(name, *args)
end

Instance Method Details

#token(*args) ⇒ Object



66
67
68
69
70
71
# File 'lib/oauth2c/cache/manager.rb', line 66

def token(*args)
  @cache.issue(@key, scope: @grant.scope) do |new_scope|
    @grant.update_scope(new_scope)
    @grant.token(*args)
  end
end