Class: Gmailish::Account
- Inherits:
-
Object
- Object
- Gmailish::Account
- Defined in:
- lib/gmailish/account.rb
Constant Summary collapse
- ADDRESS =
'imap.gmail.com'
- PORT =
993
- UNREAD =
'UNSEEN'
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(username, password) ⇒ Account
constructor
A new instance of Account.
- #messages ⇒ Object
- #process ⇒ Object
Constructor Details
#initialize(username, password) ⇒ Account
Returns a new instance of Account.
7 8 9 10 |
# File 'lib/gmailish/account.rb', line 7 def initialize(username, password) @username = username @password = password end |
Class Method Details
.process(username, password) ⇒ Object
12 13 14 |
# File 'lib/gmailish/account.rb', line 12 def self.process(username, password) new(username, password).process end |
Instance Method Details
#messages ⇒ Object
21 22 23 24 25 |
# File 'lib/gmailish/account.rb', line 21 def @messages ||= account.uid_search([UNREAD]).map do |uid| Message.process(account, uid) end end |
#process ⇒ Object
16 17 18 19 |
# File 'lib/gmailish/account.rb', line 16 def process actions.process { } self end |