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.



12
13
14
15
# File 'lib/imap/backup/mirror.rb', line 12

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

Instance Attribute Details

#folderObject (readonly)

Returns the value of attribute folder.



8
9
10
# File 'lib/imap/backup/mirror.rb', line 8

def folder
  @folder
end

#serializerObject (readonly)

Returns the value of attribute serializer.



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

def serializer
  @serializer
end

Instance Method Details

#runObject



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

def run
  ensure_destination_folder
  delete_destination_only_emails
  update_flags
  append_emails
  map.save
end