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

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

Overview

Requests an updated backup path from the user

Instance Method Summary collapse

Constructor Details

#initialize(account:, config:) ⇒ BackupPath

Returns a new instance of BackupPath.

Parameters:



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

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

Instance Method Details

#runvoid

This method returns an undefined value.

Asks the user for a backup path



18
19
20
21
22
23
24
# File 'lib/imap/backup/setup/backup_path.rb', line 18

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