Module: Gmail::Client

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

Defined Under Namespace

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

Class Method Summary collapse

Class Method Details

.new(name, *args) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/gmail/client.rb', line 17

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



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

def self.register(name, klass)
  @clients ||= {}
  @clients[name] = klass
end