Module: Webhookdb::Oauth

Defined in:
lib/webhookdb/oauth.rb

Defined Under Namespace

Classes: FakeProvider, FrontProvider, FrontSignalwireChannelProvider, IncreaseProvider, IntercomProvider, Provider, Session, Tokens

Class Method Summary collapse

Class Method Details

.provider(key) ⇒ Provider

Returns:



48
49
50
# File 'lib/webhookdb/oauth.rb', line 48

def provider(key)
  return self.registry.fetch(key).new
end

.register(cls) ⇒ Object

Raises:

  • (KeyError)


41
42
43
44
45
# File 'lib/webhookdb/oauth.rb', line 41

def register(cls)
  key = cls.new.key
  raise KeyError, "#{key} already registered to #{cls}" if self.registry.include?(key)
  self.registry[key] = cls
end

.registryHash

Returns:

  • (Hash)


53
54
55
# File 'lib/webhookdb/oauth.rb', line 53

def registry
  return @registry ||= {}
end