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.



15
16
17
18
# File 'lib/imap/backup/setup/account/header.rb', line 15

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

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



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

def 
  @account
end

Returns the value of attribute menu.



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

def menu
  @menu
end

Instance Method Details

#runObject



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/imap/backup/setup/account/header.rb', line 20

def run
  rows = [
    email,
    password,
    server,
    connection_options,
    mode,
    path,
    folders,
    multi_fetch,
    reset_seen_flags_after_fetch
  ].compact

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

    #{format_rows(rows)}

    Choose an action
  HEADER
end