Class: GmailUtilities
- Inherits:
-
Object
- Object
- GmailUtilities
- Defined in:
- lib/gmailUtilities.rb
Class Method Summary collapse
Class Method Details
.readLatestMailFromGmail(username, password, sender) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/gmailUtilities.rb', line 4 def self.readLatestMailFromGmail(username,password,sender) gmail = Gmail.connect(username, password) numberOfEmails=gmail.inbox.emails(:from => sender).length mail=gmail.inbox.emails(:from => sender)[numberOfEmails-1] linkInTheEmail=mail.html_part.decoded.scan(/<a.+?href="(.+?)".+?/)[0] return linkInTheEmail end |