Class: Imap::Backup::Setup::FolderChooser

Inherits:
Object
  • Object
show all
Defined in:
lib/imap/backup/setup/folder_chooser.rb

Overview

Allows the user to select and deselect folders to be backed up

Instance Method Summary collapse

Constructor Details

#initialize(account) ⇒ FolderChooser

Returns a new instance of FolderChooser.

Parameters:



11
12
13
# File 'lib/imap/backup/setup/folder_chooser.rb', line 11

def initialize()
  @account = 
end

Instance Method Details

#runvoid

This method returns an undefined value.

Lists account folders and allows the user to toggle whther they are selected



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/imap/backup/setup/folder_chooser.rb', line 17

def run
  if client.nil?
    highline.ask "Press a key "
    return
  end

  if folder_names.empty?
    Logger.logger.warn "Unable to get folder list"
    highline.ask "Press a key "
    return
  end

  remove_missing

  catch :done do
    loop do
      Kernel.system("clear")
      show_menu
    end
  end
end