Class: Thunderbird::MailboxExporter

Inherits:
Object
  • Object
show all
Defined in:
lib/imap/backup/thunderbird/mailbox_exporter.rb

Constant Summary collapse

EXPORT_PREFIX =
"imap-backup".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(email, serializer, profile, force: false) ⇒ MailboxExporter

Returns a new instance of MailboxExporter.


13
14
15
16
17
18
# File 'lib/imap/backup/thunderbird/mailbox_exporter.rb', line 13

def initialize(email, serializer, profile, force: false)
  @email = email
  @serializer = serializer
  @profile = profile
  @force = force
end

Instance Attribute Details

#emailObject (readonly)

Returns the value of attribute email.


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

def email
  @email
end

#forceObject (readonly)

Returns the value of attribute force.


11
12
13
# File 'lib/imap/backup/thunderbird/mailbox_exporter.rb', line 11

def force
  @force
end

#profileObject (readonly)

Returns the value of attribute profile.


10
11
12
# File 'lib/imap/backup/thunderbird/mailbox_exporter.rb', line 10

def profile
  @profile
end

#serializerObject (readonly)

Returns the value of attribute serializer.


9
10
11
# File 'lib/imap/backup/thunderbird/mailbox_exporter.rb', line 9

def serializer
  @serializer
end

Instance Method Details

#runObject


20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/imap/backup/thunderbird/mailbox_exporter.rb', line 20

def run
  local_folder_ok = local_folder.set_up
  return false if !local_folder_ok

  skip_for_msf = check_msf
  return false if skip_for_msf

  skip_for_local_folder = check_local_folder
  return false if skip_for_local_folder

  copy_messages

  true
end