Class: Radfish::BmcInfo
- Inherits:
-
Object
- Object
- Radfish::BmcInfo
- Defined in:
- lib/radfish/bmc_info.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #firmware_version ⇒ Object
- #health ⇒ Object
- #hostname ⇒ Object
-
#initialize(client) ⇒ BmcInfo
constructor
A new instance of BmcInfo.
- #ip_address ⇒ Object
- #keys ⇒ Object
- #license_version ⇒ Object
- #mac_address ⇒ Object
- #redfish_version ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(client) ⇒ BmcInfo
Returns a new instance of BmcInfo.
7 8 9 10 |
# File 'lib/radfish/bmc_info.rb', line 7 def initialize(client) @client = client @cache = {} end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
5 6 7 |
# File 'lib/radfish/bmc_info.rb', line 5 def client @client end |
Instance Method Details
#firmware_version ⇒ Object
26 27 28 |
# File 'lib/radfish/bmc_info.rb', line 26 def firmware_version fetch_bmc_info[:firmware_version] || fetch_bmc_info[:bmc_firmware_version] end |
#health ⇒ Object
46 47 48 |
# File 'lib/radfish/bmc_info.rb', line 46 def health fetch_bmc_info[:health] || fetch_bmc_info[:bmc_health] end |
#hostname ⇒ Object
42 43 44 |
# File 'lib/radfish/bmc_info.rb', line 42 def hostname fetch_bmc_info[:hostname] || fetch_bmc_info[:bmc_hostname] end |
#ip_address ⇒ Object
38 39 40 |
# File 'lib/radfish/bmc_info.rb', line 38 def ip_address fetch_bmc_info[:ip_address] || fetch_bmc_info[:bmc_ip_address] end |
#keys ⇒ Object
12 13 14 |
# File 'lib/radfish/bmc_info.rb', line 12 def keys [:license_version, :firmware_version, :redfish_version, :mac_address, :ip_address, :hostname, :health] end |
#license_version ⇒ Object
22 23 24 |
# File 'lib/radfish/bmc_info.rb', line 22 def license_version fetch_bmc_info[:license_version] || fetch_bmc_info[:bmc_license_version] end |
#mac_address ⇒ Object
34 35 36 |
# File 'lib/radfish/bmc_info.rb', line 34 def mac_address fetch_bmc_info[:mac_address] || fetch_bmc_info[:bmc_mac_address] end |
#redfish_version ⇒ Object
30 31 32 |
# File 'lib/radfish/bmc_info.rb', line 30 def redfish_version fetch_bmc_info[:redfish_version] end |
#to_h ⇒ Object
16 17 18 19 20 |
# File 'lib/radfish/bmc_info.rb', line 16 def to_h keys.each_with_object({}) do |key, hash| hash[key] = send(key) end end |