Module: Gmail::Client

Defined in:
lib/gmail/client.rb,
lib/gmail/client/base.rb,
lib/gmail/client/plain.rb,
lib/gmail/client/xoauth.rb,
lib/gmail/client/xoauth2.rb

Defined Under Namespace

Classes: AuthorizationError, Base, ConnectionError, DeliveryError, Plain, UnknownClient, XOAuth, XOAuth2

Class Method Summary collapse

Class Method Details

.clientsObject


12
13
14
# File 'lib/gmail/client.rb', line 12

def self.clients
  @clients ||= {}
end

.new(name, *args) ⇒ Object


20
21
22
23
24
25
26
# File 'lib/gmail/client.rb', line 20

def self.new(name, *args)
  if client = clients[name]
    client.new(*args)
  else
    raise UnknownClient, "No such client: #{name}"
  end
end

.register(name, klass) ⇒ Object


16
17
18
# File 'lib/gmail/client.rb', line 16

def self.register(name, klass)
  clients[name] = klass
end