Class: Thunderbird::MailboxExporter
- Inherits:
-
Object
- Object
- Thunderbird::MailboxExporter
- Defined in:
- lib/imap/backup/thunderbird/mailbox_exporter.rb
Constant Summary collapse
- EXPORT_PREFIX =
"imap-backup".freeze
Instance Attribute Summary collapse
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#force ⇒ Object
readonly
Returns the value of attribute force.
-
#profile ⇒ Object
readonly
Returns the value of attribute profile.
-
#serializer ⇒ Object
readonly
Returns the value of attribute serializer.
Instance Method Summary collapse
-
#initialize(email, serializer, profile, force: false) ⇒ MailboxExporter
constructor
A new instance of MailboxExporter.
- #run ⇒ Object
Constructor Details
#initialize(email, serializer, profile, force: false) ⇒ MailboxExporter
Returns a new instance of MailboxExporter.
15 16 17 18 19 20 |
# File 'lib/imap/backup/thunderbird/mailbox_exporter.rb', line 15 def initialize(email, serializer, profile, force: false) @email = email @serializer = serializer @profile = profile @force = force end |
Instance Attribute Details
#email ⇒ Object (readonly)
Returns the value of attribute email.
10 11 12 |
# File 'lib/imap/backup/thunderbird/mailbox_exporter.rb', line 10 def email @email end |
#force ⇒ Object (readonly)
Returns the value of attribute force.
13 14 15 |
# File 'lib/imap/backup/thunderbird/mailbox_exporter.rb', line 13 def force @force end |
#profile ⇒ Object (readonly)
Returns the value of attribute profile.
12 13 14 |
# File 'lib/imap/backup/thunderbird/mailbox_exporter.rb', line 12 def profile @profile end |
#serializer ⇒ Object (readonly)
Returns the value of attribute serializer.
11 12 13 |
# File 'lib/imap/backup/thunderbird/mailbox_exporter.rb', line 11 def serializer @serializer end |
Instance Method Details
#run ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/imap/backup/thunderbird/mailbox_exporter.rb', line 22 def run if !profile_set_up error "The Thunderbird profile '#{profile.title}' " \ "has not been set up. " \ "Please set it up before trying to export" return false end local_folder_ok = local_folder.set_up if !local_folder_ok error "Failed to set up local folder" return false end 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 info "Exporting account '#{email}' to folder '#{local_folder.full_path}'" true end |