Class: Howitzer::GmailApi::Client
- Inherits:
-
Object
- Object
- Howitzer::GmailApi::Client
- Defined in:
- lib/howitzer/gmail_api/client.rb
Overview
A GmailApi::Client object is used to communicate with the Gmail API.
Class Method Summary collapse
Instance Method Summary collapse
-
#find_message(recipient, subject) ⇒ Gmail::Message
Finds message according to given parameters.
-
#initialize ⇒ Client
constructor
A new instance of Client.
Constructor Details
Class Method Details
.load_gmail_gem! ⇒ Object
5 6 7 8 9 |
# File 'lib/howitzer/gmail_api/client.rb', line 5 def self.load_gmail_gem! require 'gmail' rescue LoadError raise LoadError, "Unable to load `gmail` library, please add following code to your Gemfile:\n\ngem 'gmail'" end |
Instance Method Details
#find_message(recipient, subject) ⇒ Gmail::Message
Finds message according to given parameters
22 23 24 |
# File 'lib/howitzer/gmail_api/client.rb', line 22 def (recipient, subject) client.inbox.emails(to: recipient, subject: subject).last end |