Class: DInstallerCli::Clients::Storage

Inherits:
DInstaller::DBus::Clients::Base
  • Object
show all
Defined in:
lib/dinstaller_cli/clients/storage.rb

Overview

D-Bus client for storage configuration

Instance Method Summary collapse

Constructor Details

#initializeStorage



28
29
30
31
32
33
# File 'lib/dinstaller_cli/clients/storage.rb', line 28

def initialize
  super

  @dbus_proposal = service.object("/org/opensuse/DInstaller/Storage/Proposal1")
  @dbus_proposal.introspect
end

Instance Method Details

#actionsArray<String>

Actions to perform in the storage devices



56
57
58
# File 'lib/dinstaller_cli/clients/storage.rb', line 56

def actions
  dbus_proposal["org.opensuse.DInstaller.Storage.Proposal1"]["Actions"].map { |a| a["Text"] }
end

#available_devicesArray<String>

Devices available for the installation



42
43
44
# File 'lib/dinstaller_cli/clients/storage.rb', line 42

def available_devices
  dbus_proposal["org.opensuse.DInstaller.Storage.Proposal1"]["AvailableDevices"].map(&:first)
end

#calculate(candidate_devices) ⇒ Object

Calculates the storage proposal with the given devices



63
64
65
# File 'lib/dinstaller_cli/clients/storage.rb', line 63

def calculate(candidate_devices)
  dbus_proposal.Calculate({ "CandidateDevices" => candidate_devices })
end

#candidate_devicesArray<String>

Devices selected for the installation



49
50
51
# File 'lib/dinstaller_cli/clients/storage.rb', line 49

def candidate_devices
  dbus_proposal["org.opensuse.DInstaller.Storage.Proposal1"]["CandidateDevices"]
end

#service_nameObject



35
36
37
# File 'lib/dinstaller_cli/clients/storage.rb', line 35

def service_name
  @service_name ||= "org.opensuse.DInstaller"
end