Class: DInstallerCli::InstallConfig::Root

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

Overview

Class to represent the root user config

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(password: nil, ssh_key: nil) ⇒ Root

Constructor

Parameters:

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


132
133
134
135
# File 'lib/dinstaller_cli/install_config.rb', line 132

def initialize(password: nil, ssh_key: nil)
  @password = password
  @ssh_key = ssh_key
end

Instance Attribute Details

#passwordString?

Returns:

  • (String, nil)


123
124
125
# File 'lib/dinstaller_cli/install_config.rb', line 123

def password
  @password
end

#ssh_keyString?

Returns:

  • (String, nil)


126
127
128
# File 'lib/dinstaller_cli/install_config.rb', line 126

def ssh_key
  @ssh_key
end

Instance Method Details

#to_hHash

Converts the settings to hash

Returns:

  • (Hash)


140
141
142
143
144
145
# File 'lib/dinstaller_cli/install_config.rb', line 140

def to_h
  {
    "ssh_key"  => ssh_key,
    "password" => password
  }
end