Class: Imap::Backup::Mirror
- Inherits:
-
Object
- Object
- Imap::Backup::Mirror
- Defined in:
- lib/imap/backup/mirror.rb,
lib/imap/backup/mirror/map.rb
Overview
Synchronises a folder between a source and destination
Defined Under Namespace
Classes: Map
Instance Method Summary collapse
-
#initialize(serializer, folder, reset: false) ⇒ Mirror
constructor
A new instance of Mirror.
-
#run ⇒ void
If necessary, creates the destination folder, then deletes any messages in the destination folder that are not in the local store, sets existing messages’ flags then appends any missing messages and saves the mapping file.
Constructor Details
#initialize(serializer, folder, reset: false) ⇒ Mirror
Returns a new instance of Mirror.
11 12 13 14 15 |
# File 'lib/imap/backup/mirror.rb', line 11 def initialize(serializer, folder, reset: false) @serializer = serializer @folder = folder @reset = reset end |
Instance Method Details
#run ⇒ void
This method returns an undefined value.
If necessary, creates the destination folder, then deletes any messages in the destination folder that are not in the local store, sets existing messages’ flags then appends any missing messages and saves the mapping file
24 25 26 27 28 29 30 |
# File 'lib/imap/backup/mirror.rb', line 24 def run ensure_destination_folder delete_destination_only_emails if reset update_flags append_emails map.save end |