Class: Howitzer::GmailApi::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/howitzer/gmail_api/client.rb

Overview

A GmailApi::Client object is used to communicate with the Gmail API.

Instance Method Summary collapse

Constructor Details

#initializeClient


7
8
9
# File 'lib/howitzer/gmail_api/client.rb', line 7

def initialize
  @client = Gmail.connect(Howitzer., Howitzer.gmail_password)
end

Instance Method Details

#find_message(recipient, subject) ⇒ Gmail::Message

Finds message according to given parameters


17
18
19
# File 'lib/howitzer/gmail_api/client.rb', line 17

def find_message(recipient, subject)
  @client.inbox.emails(to: recipient, subject: subject).last
end