Class: Imap::Backup::Client::Default
- Inherits:
-
Object
- Object
- Imap::Backup::Client::Default
- Extended by:
- Forwardable
- Defined in:
- lib/imap/backup/client/default.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#state ⇒ Object
Returns the value of attribute state.
Instance Method Summary collapse
-
#disconnect ⇒ Object
Track mailbox selection during delegation to Net::IMAP instance.
- #examine(mailbox) ⇒ Object
-
#initialize(*args) ⇒ Default
constructor
A new instance of Default.
- #list ⇒ Object
- #select(mailbox) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Default
Returns a new instance of Default.
17 18 19 20 |
# File 'lib/imap/backup/client/default.rb', line 17 def initialize(*args) @args = args @state = nil end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
14 15 16 |
# File 'lib/imap/backup/client/default.rb', line 14 def args @args end |
#state ⇒ Object
Returns the value of attribute state.
15 16 17 |
# File 'lib/imap/backup/client/default.rb', line 15 def state @state end |
Instance Method Details
#disconnect ⇒ Object
Track mailbox selection during delegation to Net::IMAP instance
33 34 35 36 |
# File 'lib/imap/backup/client/default.rb', line 33 def disconnect imap.disconnect self.state = nil end |
#examine(mailbox) ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/imap/backup/client/default.rb', line 38 def examine(mailbox) return if state == [:examine, mailbox] result = imap.examine(mailbox) self.state = [:examine, mailbox] result end |
#list ⇒ Object
22 23 24 25 26 27 28 29 |
# File 'lib/imap/backup/client/default.rb', line 22 def list root = provider_root mailbox_lists = imap.list(root, "*") return [] if mailbox_lists.nil? mailbox_lists.map { |ml| extract_name(ml) } end |
#select(mailbox) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/imap/backup/client/default.rb', line 46 def select(mailbox) return if state == [:select, mailbox] imap.select(mailbox) self.state = [:select, mailbox] end |