Class: Netatmo::Weather::WifiStatus

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/netatmo/weather/wifi_status.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#valueObject

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

#statusObject



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_sObject



16
17
18
# File 'lib/netatmo/weather/wifi_status.rb', line 16

def to_s
  status.to_s
end