Class: Radfish::Controller
- Inherits:
-
Object
- Object
- Radfish::Controller
- Defined in:
- lib/radfish/controller.rb
Overview
Lightweight value object representing a storage controller. Holds a stable identifier and optional name.
Instance Attribute Summary collapse
-
#adapter_data ⇒ Object
readonly
Returns the value of attribute adapter_data.
-
#battery_status ⇒ Object
readonly
Returns the value of attribute battery_status.
-
#controller_type ⇒ Object
readonly
Returns the value of attribute controller_type.
-
#drives_count ⇒ Object
readonly
Returns the value of attribute drives_count.
-
#encryption_capability ⇒ Object
readonly
Returns the value of attribute encryption_capability.
-
#encryption_mode ⇒ Object
readonly
Returns the value of attribute encryption_mode.
-
#firmware_version ⇒ Object
readonly
Returns the value of attribute firmware_version.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pci_slot ⇒ Object
readonly
Returns the value of attribute pci_slot.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#vendor ⇒ Object
readonly
Returns the value of attribute vendor.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#drives ⇒ Object
Convenience accessors delegate to the client wrappers.
-
#initialize(client:, id:, name: nil, model: nil, vendor: nil, adapter_data: nil, firmware_version: nil, encryption_mode: nil, encryption_capability: nil, controller_type: nil, pci_slot: nil, status: nil, drives_count: nil, battery_status: nil) ⇒ Controller
constructor
A new instance of Controller.
- #to_h ⇒ Object
- #volumes ⇒ Object
Constructor Details
#initialize(client:, id:, name: nil, model: nil, vendor: nil, adapter_data: nil, firmware_version: nil, encryption_mode: nil, encryption_capability: nil, controller_type: nil, pci_slot: nil, status: nil, drives_count: nil, battery_status: nil) ⇒ Controller
Returns a new instance of Controller.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/radfish/controller.rb', line 11 def initialize(client:, id:, name: nil, model: nil, vendor: nil, adapter_data: nil, firmware_version: nil, encryption_mode: nil, encryption_capability: nil, controller_type: nil, pci_slot: nil, status: nil, drives_count: nil, battery_status: nil) @client = client @id = id @name = name @model = model @vendor = vendor @adapter_data = adapter_data @firmware_version = firmware_version @encryption_mode = encryption_mode @encryption_capability = encryption_capability @controller_type = controller_type @pci_slot = pci_slot @status = status @drives_count = drives_count @battery_status = battery_status end |
Instance Attribute Details
#adapter_data ⇒ Object (readonly)
Returns the value of attribute adapter_data.
7 8 9 |
# File 'lib/radfish/controller.rb', line 7 def adapter_data @adapter_data end |
#battery_status ⇒ Object (readonly)
Returns the value of attribute battery_status.
7 8 9 |
# File 'lib/radfish/controller.rb', line 7 def battery_status @battery_status end |
#controller_type ⇒ Object (readonly)
Returns the value of attribute controller_type.
7 8 9 |
# File 'lib/radfish/controller.rb', line 7 def controller_type @controller_type end |
#drives_count ⇒ Object (readonly)
Returns the value of attribute drives_count.
7 8 9 |
# File 'lib/radfish/controller.rb', line 7 def drives_count @drives_count end |
#encryption_capability ⇒ Object (readonly)
Returns the value of attribute encryption_capability.
7 8 9 |
# File 'lib/radfish/controller.rb', line 7 def encryption_capability @encryption_capability end |
#encryption_mode ⇒ Object (readonly)
Returns the value of attribute encryption_mode.
7 8 9 |
# File 'lib/radfish/controller.rb', line 7 def encryption_mode @encryption_mode end |
#firmware_version ⇒ Object (readonly)
Returns the value of attribute firmware_version.
7 8 9 |
# File 'lib/radfish/controller.rb', line 7 def firmware_version @firmware_version end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
7 8 9 |
# File 'lib/radfish/controller.rb', line 7 def id @id end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
7 8 9 |
# File 'lib/radfish/controller.rb', line 7 def model @model end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/radfish/controller.rb', line 7 def name @name end |
#pci_slot ⇒ Object (readonly)
Returns the value of attribute pci_slot.
7 8 9 |
# File 'lib/radfish/controller.rb', line 7 def pci_slot @pci_slot end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/radfish/controller.rb', line 7 def status @status end |
#vendor ⇒ Object (readonly)
Returns the value of attribute vendor.
7 8 9 |
# File 'lib/radfish/controller.rb', line 7 def vendor @vendor end |
Instance Method Details
#==(other) ⇒ Object
57 58 59 |
# File 'lib/radfish/controller.rb', line 57 def ==(other) other.is_a?(Controller) && other.id == id && other.vendor.to_s == vendor.to_s end |
#drives ⇒ Object
Convenience accessors delegate to the client wrappers
32 33 34 |
# File 'lib/radfish/controller.rb', line 32 def drives @client.drives(self) end |
#to_h ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/radfish/controller.rb', line 40 def to_h { id: id, name: name, model: model, vendor: vendor, firmware_version: firmware_version, encryption_mode: encryption_mode, encryption_capability: encryption_capability, controller_type: controller_type, pci_slot: pci_slot, status: status, drives_count: drives_count, battery_status: battery_status }.compact end |
#volumes ⇒ Object
36 37 38 |
# File 'lib/radfish/controller.rb', line 36 def volumes @client.volumes(self) end |