Class: Imap::Backup::Account::Folder
- Inherits:
-
Object
- Object
- Imap::Backup::Account::Folder
- Extended by:
- Forwardable
- Defined in:
- lib/imap/backup/account/folder.rb
Constant Summary collapse
- REQUESTED_ATTRIBUTES =
['RFC822', 'FLAGS', 'INTERNALDATE']
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #fetch(uid) ⇒ Object
- #folder ⇒ Object
-
#initialize(connection, name) ⇒ Folder
constructor
A new instance of Folder.
- #uids ⇒ Object
Constructor Details
#initialize(connection, name) ⇒ Folder
Returns a new instance of Folder.
17 18 19 20 |
# File 'lib/imap/backup/account/folder.rb', line 17 def initialize(connection, name) @connection = connection @name = name end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
12 13 14 |
# File 'lib/imap/backup/account/folder.rb', line 12 def connection @connection end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'lib/imap/backup/account/folder.rb', line 13 def name @name end |
Instance Method Details
#fetch(uid) ⇒ Object
34 35 36 37 38 39 40 41 42 |
# File 'lib/imap/backup/account/folder.rb', line 34 def fetch(uid) imap.examine(name) = imap.uid_fetch([uid.to_i], REQUESTED_ATTRIBUTES)[0][1] ['RFC822'].force_encoding('utf-8') if RUBY_VERSION > '1.9' rescue Net::IMAP::NoResponseError => e Imap::Backup.logger.warn "Folder '#{name}' does not exist" nil end |
#folder ⇒ Object
22 23 24 |
# File 'lib/imap/backup/account/folder.rb', line 22 def folder name end |