Class: Rmsgen::IMAPClient
- Inherits:
-
Object
- Object
- Rmsgen::IMAPClient
- Extended by:
- Forwardable
- Defined in:
- lib/rmsgen/imap_client.rb
Constant Summary collapse
- INBOX =
'INBOX'
- RMS_EMAIL =
'[email protected]'
- RFC822 =
'RFC822'
Instance Method Summary collapse
- #authenticate ⇒ Object
- #fetch_polnote_messages_from_inbox(&block) ⇒ Object
- #find_by_id(id) ⇒ Object
-
#initialize(options) ⇒ IMAPClient
constructor
A new instance of IMAPClient.
Constructor Details
#initialize(options) ⇒ IMAPClient
Returns a new instance of IMAPClient.
13 14 15 16 17 18 |
# File 'lib/rmsgen/imap_client.rb', line 13 def initialize() @server = ['imap_server'] @login = ['imap_login'] @password = ['imap_password'] @imap_client = Net::IMAP.new(@server) end |
Instance Method Details
#authenticate ⇒ Object
22 23 24 |
# File 'lib/rmsgen/imap_client.rb', line 22 def authenticate @imap_client.authenticate('LOGIN', @login, @password) end |
#fetch_polnote_messages_from_inbox(&block) ⇒ Object
26 27 28 29 30 |
# File 'lib/rmsgen/imap_client.rb', line 26 def (&block) authenticate select INBOX find_all_from_rms(&block) end |
#find_by_id(id) ⇒ Object
32 33 34 35 |
# File 'lib/rmsgen/imap_client.rb', line 32 def find_by_id(id) select INBOX (id) end |