Class: Imap::Backup::Setup::BackupPath

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(account:, config:) ⇒ BackupPath

Returns a new instance of BackupPath.


8
9
10
11
# File 'lib/imap/backup/setup/backup_path.rb', line 8

def initialize(account:, config:)
  @account = 
  @config = config
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.


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

def 
  @account
end

#configObject (readonly)

Returns the value of attribute config.


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

def config
  @config
end

Instance Method Details

#runObject


13
14
15
16
17
18
19
20
# File 'lib/imap/backup/setup/backup_path.rb', line 13

def run
  .local_path = highline.ask("backup directory: ") do |q|
    q.default  = .local_path
    q.readline = true
    q.validate = ->(path) { path_modification_validator(path) }
    q.responses[:not_valid] = "Choose a different directory "
  end
end