Module: Gmail

Defined in:
lib/gmail.rb,
lib/gmail/client.rb,
lib/gmail/labels.rb,
lib/gmail/mailbox.rb,
lib/gmail/message.rb,
lib/gmail/version.rb

Defined Under Namespace

Classes: Client, Labels, Mailbox, Message, Version

Class Method Summary collapse

Class Method Details

.new(email, token, secret, consumer_key, consumer_secret, options = {}, &block) ⇒ Object Also known as: connect



26
27
28
29
30
31
32
33
34
# File 'lib/gmail.rb', line 26

def new(email, token, secret, consumer_key, consumer_secret, options={}, &block)
  client = Client.new(email, token, secret, consumer_key, consumer_secret, options)
  client.connect and client.
  if block_given?
    yield client
    client.logout
  end
  client
end

.new!(email, token, secret, consumer_key, consumer_secret, options = {}, &block) ⇒ Object Also known as: connect!



37
38
39
40
41
42
43
44
45
# File 'lib/gmail.rb', line 37

def new!(email, token, secret, consumer_key, consumer_secret, options={}, &block)
  client = Client.new(email, token, secret, consumer_key, consumer_secret, options)
  client.connect! and client.login!
  if block_given?
    yield client
    client.logout
  end
  client
end

.versionObject

Version



9
10
11
# File 'lib/gmail/version.rb', line 9

def self.version # :nodoc:
  Version::STRING
end