Class: ImapAccounts

Inherits:
Hash
  • Object
show all
Defined in:
lib/feed2imap/imap.rb

Overview

This class is a container of IMAP accounts. Thanks to it, accounts are re-used : several feeds using the same IMAP account will create only one IMAP connection.

Instance Method Summary collapse

Instance Method Details

#add_account(uri) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/feed2imap/imap.rb', line 35

def (uri)
  u = URI::Generic::build({ :scheme => uri.scheme,
                            :userinfo => uri.userinfo,
                            :host => uri.host,
                            :port => uri.port })
  if not include?(u)
    ac = ImapAccount::new(u)
    self[u] = ac
  end
  return self[u]
end