Class: Imap::Backup::Mirror

Inherits:
Object
  • Object
show all
Defined in:
lib/imap/backup/mirror.rb,
lib/imap/backup/mirror/map.rb

Defined Under Namespace

Classes: Map

Constant Summary collapse

CHUNK_SIZE =
100

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(serializer, folder) ⇒ Mirror

Returns a new instance of Mirror.


10
11
12
13
# File 'lib/imap/backup/mirror.rb', line 10

def initialize(serializer, folder)
  @serializer = serializer
  @folder = folder
end

Instance Attribute Details

#folderObject (readonly)

Returns the value of attribute folder.


6
7
8
# File 'lib/imap/backup/mirror.rb', line 6

def folder
  @folder
end

#serializerObject (readonly)

Returns the value of attribute serializer.


5
6
7
# File 'lib/imap/backup/mirror.rb', line 5

def serializer
  @serializer
end

Instance Method Details

#runObject


15
16
17
18
19
20
21
# File 'lib/imap/backup/mirror.rb', line 15

def run
  ensure_destination_folder
  delete_destination_only_emails
  update_flags
  append_emails
  map.save
end