Class: DInstallerCli::Clients::Storage
- Inherits:
-
DInstaller::DBus::Clients::Base
- Object
- DInstaller::DBus::Clients::Base
- DInstallerCli::Clients::Storage
- Defined in:
- lib/dinstaller_cli/clients/storage.rb
Overview
D-Bus client for storage configuration
Instance Method Summary collapse
-
#actions ⇒ Array<String>
Actions to perform in the storage devices.
-
#available_devices ⇒ Array<String>
Devices available for the installation.
-
#calculate(candidate_devices) ⇒ Object
Calculates the storage proposal with the given devices.
-
#candidate_devices ⇒ Array<String>
Devices selected for the installation.
-
#initialize ⇒ Storage
constructor
A new instance of Storage.
- #service_name ⇒ Object
Constructor Details
#initialize ⇒ Storage
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
#actions ⇒ Array<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_devices ⇒ Array<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_devices ⇒ Array<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_name ⇒ Object
35 36 37 |
# File 'lib/dinstaller_cli/clients/storage.rb', line 35 def service_name @service_name ||= "org.opensuse.DInstaller" end |