Class: Netatmo::Weather::WifiStatus
- Inherits:
-
Object
- Object
- Netatmo::Weather::WifiStatus
- Extended by:
- Forwardable
- Defined in:
- lib/netatmo/weather/wifi_status.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(value) ⇒ WifiStatus
constructor
A new instance of WifiStatus.
- #status ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(value) ⇒ WifiStatus
Returns a new instance of WifiStatus.
12 13 14 |
# File 'lib/netatmo/weather/wifi_status.rb', line 12 def initialize(value) self.value = value end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
10 11 12 |
# File 'lib/netatmo/weather/wifi_status.rb', line 10 def value @value end |
Instance Method Details
#status ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/netatmo/weather/wifi_status.rb', line 20 def status case value when 0..56 Netatmo::Util::WifiStatus.good when 57..71 Netatmo::Util::WifiStatus.average when value > 72 Netatmo::Util::WifiStatus.bad end end |
#to_s ⇒ Object
16 17 18 |
# File 'lib/netatmo/weather/wifi_status.rb', line 16 def to_s status.to_s end |