Class: DInstallerCli::InstallConfig::User

Inherits:
Object
  • Object
show all
Defined in:
lib/dinstaller_cli/install_config.rb

Overview

Class to represent the user config

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name: nil, fullname: nil, password: nil, autologin: false) ⇒ User

Constructor

Parameters:

  • name (String) (defaults to: nil)

    user name

  • fullname (String, nil) (defaults to: nil)

    full user name

  • password (String, nil) (defaults to: nil)

    user password

  • autologin (Boolean) (defaults to: false)

    user autologin option



100
101
102
103
104
105
# File 'lib/dinstaller_cli/install_config.rb', line 100

def initialize(name: nil, fullname: nil, password: nil, autologin: false)
  @name = name
  @fullname = fullname
  @password = password
  @autologin = autologin
end

Instance Attribute Details

#autologinObject

Parameters:

  • (Boolean)


92
93
94
# File 'lib/dinstaller_cli/install_config.rb', line 92

def autologin
  @autologin
end

#fullnameObject

Parameters:

  • (String, nil)


86
87
88
# File 'lib/dinstaller_cli/install_config.rb', line 86

def fullname
  @fullname
end

#nameObject

Parameters:

  • (String, nil)


83
84
85
# File 'lib/dinstaller_cli/install_config.rb', line 83

def name
  @name
end

#passwordObject

Parameters:

  • (String, nil)


89
90
91
# File 'lib/dinstaller_cli/install_config.rb', line 89

def password
  @password
end

Instance Method Details

#to_hHash

Converts the settings to hash

Returns:

  • (Hash)


110
111
112
113
114
115
116
117
# File 'lib/dinstaller_cli/install_config.rb', line 110

def to_h
  {
    "name"      => name,
    "fullname"  => fullname,
    "autologin" => autologin,
    "password"  => password
  }
end