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
- .new(email, token, secret, consumer_key, consumer_secret, options = {}, &block) ⇒ Object (also: connect)
- .new!(email, token, secret, consumer_key, consumer_secret, options = {}, &block) ⇒ Object (also: connect!)
-
.version ⇒ Object
Version.
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, ={}, &block) client = Client.new(email, token, secret, consumer_key, consumer_secret, ) client.connect and client.login 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, ={}, &block) client = Client.new(email, token, secret, consumer_key, consumer_secret, ) client.connect! and client.login! if block_given? yield client client.logout end client end |