Class: Rmsgen::IMAPPolnoteGroup
- Inherits:
-
Object
- Object
- Rmsgen::IMAPPolnoteGroup
- Defined in:
- lib/rmsgen/imap_polnote_group.rb
Instance Method Summary collapse
- #archive_polnote(id) ⇒ Object
- #fetch_notes ⇒ Object
- #find(id) ⇒ Object
-
#initialize(imap, options = {}) ⇒ IMAPPolnoteGroup
constructor
A new instance of IMAPPolnoteGroup.
- #note_ids ⇒ Object
Constructor Details
#initialize(imap, options = {}) ⇒ IMAPPolnoteGroup
Returns a new instance of IMAPPolnoteGroup.
5 6 7 8 9 |
# File 'lib/rmsgen/imap_polnote_group.rb', line 5 def initialize(imap, ={}) @imap = imap @login = ['imap_login'] @password = ['imap_password'] end |
Instance Method Details
#archive_polnote(id) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/rmsgen/imap_polnote_group.rb', line 28 def archive_polnote(id) authenticate follow_inbox archived = false @imap.search(["FROM", 'rms@gnu.org']).each do |note_id| if note_id.to_i == id.to_i @imap.copy id.to_i, 'INBOX.old-messages' @imap.store(id.to_i, "+FLAGS", [:Deleted]) @imap.expunge archived = true end end archived end |
#fetch_notes ⇒ Object
11 12 13 14 15 |
# File 'lib/rmsgen/imap_polnote_group.rb', line 11 def fetch_notes authenticate follow_inbox find_all_from_rms end |
#find(id) ⇒ Object
23 24 25 26 |
# File 'lib/rmsgen/imap_polnote_group.rb', line 23 def find(id) follow_inbox (id) end |
#note_ids ⇒ Object
17 18 19 20 21 |
# File 'lib/rmsgen/imap_polnote_group.rb', line 17 def note_ids authenticate follow_inbox @imap.search(["FROM", 'rms@gnu.org']) end |