Class: DInstallerCli::InstallConfig
- Inherits:
-
Object
- Object
- DInstallerCli::InstallConfig
- Defined in:
- lib/dinstaller_cli/install_config.rb
Overview
Class to represent the installation config
Defined Under Namespace
Instance Attribute Summary collapse
-
#disks ⇒ Array<String>
Target devices.
-
#languages ⇒ Array<String>
Languages to install.
-
#product ⇒ String?
Product to install.
-
#root ⇒ InstallConfig::Root?
Root config.
-
#user ⇒ InstallConfig::User?
User config.
Instance Method Summary collapse
-
#dump ⇒ String
Dumps the settings in YAML format.
-
#initialize ⇒ InstallConfig
constructor
A new instance of InstallConfig.
-
#to_h ⇒ Hash
Converts the settings to hash.
Constructor Details
#initialize ⇒ InstallConfig
Returns a new instance of InstallConfig.
52 53 54 55 56 57 58 |
# File 'lib/dinstaller_cli/install_config.rb', line 52 def initialize @product = nil @languages = [] @disks = [] @user = nil @root = nil end |
Instance Attribute Details
#disks ⇒ Array<String>
Target devices
40 41 42 |
# File 'lib/dinstaller_cli/install_config.rb', line 40 def disks @disks end |
#languages ⇒ Array<String>
Languages to install
35 36 37 |
# File 'lib/dinstaller_cli/install_config.rb', line 35 def languages @languages end |
#product ⇒ String?
Product to install
30 31 32 |
# File 'lib/dinstaller_cli/install_config.rb', line 30 def product @product end |
#root ⇒ InstallConfig::Root?
Root config
50 51 52 |
# File 'lib/dinstaller_cli/install_config.rb', line 50 def root @root end |
#user ⇒ InstallConfig::User?
User config
45 46 47 |
# File 'lib/dinstaller_cli/install_config.rb', line 45 def user @user end |
Instance Method Details
#dump ⇒ String
Dumps the settings in YAML format
63 64 65 |
# File 'lib/dinstaller_cli/install_config.rb', line 63 def dump to_h.to_yaml end |
#to_h ⇒ Hash
Converts the settings to hash
70 71 72 73 74 75 76 77 78 |
# File 'lib/dinstaller_cli/install_config.rb', line 70 def to_h { "product" => product, "languages" => languages, "disks" => disks, "user" => user&.to_h || {}, "root" => root&.to_h || {} } end |