Class: Imap::Backup::Setup::Account::Header

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(menu:, account:) ⇒ Header

Returns a new instance of Header.



11
12
13
14
# File 'lib/imap/backup/setup/account/header.rb', line 11

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

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



8
9
10
# File 'lib/imap/backup/setup/account/header.rb', line 8

def 
  @account
end

Returns the value of attribute menu.



9
10
11
# File 'lib/imap/backup/setup/account/header.rb', line 9

def menu
  @menu
end

Instance Method Details

#runObject



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/imap/backup/setup/account/header.rb', line 16

def run
  menu.header = <<~HEADER.chomp
    #{helpers.title_prefix} Account#{modified_flag}

    email   #{space}#{.username}
    password#{space}#{masked_password}
    path    #{space}#{local_path}
    folders #{space}#{folders.map { |f| f[:name] }.join(', ')}#{multi_fetch_size}
    server  #{space}#{.server}#{connection_options}#{reset_seen_flags_after_fetch}

    Choose an action
  HEADER
end