Class: Radfish::ThermalInfo
- Inherits:
-
Object
- Object
- Radfish::ThermalInfo
- Defined in:
- lib/radfish/thermal_info.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
Instance Method Summary collapse
- #fans ⇒ Object
-
#initialize(client) ⇒ ThermalInfo
constructor
A new instance of ThermalInfo.
- #keys ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize(client) ⇒ ThermalInfo
Returns a new instance of ThermalInfo.
7 8 9 10 |
# File 'lib/radfish/thermal_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/thermal_info.rb', line 5 def client @client end |
Instance Method Details
#fans ⇒ Object
22 23 24 |
# File 'lib/radfish/thermal_info.rb', line 22 def fans @cache[:fans] ||= @client.adapter.fans end |
#keys ⇒ Object
12 13 14 |
# File 'lib/radfish/thermal_info.rb', line 12 def keys [:fans] end |
#to_h ⇒ Object
16 17 18 19 20 |
# File 'lib/radfish/thermal_info.rb', line 16 def to_h keys.each_with_object({}) do |key, hash| hash[key] = send(key) rescue nil end end |