Class: WifiWand::SignalQuality

Inherits:
Struct
  • Object
show all
Defined in:
lib/wifi_wand/signal_quality.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#unitObject

Returns the value of attribute unit

Returns:

  • (Object)

    the current value of unit



4
5
6
# File 'lib/wifi_wand/signal_quality.rb', line 4

def unit
  @unit
end

#valueObject

Returns the value of attribute value

Returns:

  • (Object)

    the current value of value



4
5
6
# File 'lib/wifi_wand/signal_quality.rb', line 4

def value
  @value
end

Instance Method Details

#to_sObject



5
6
7
# File 'lib/wifi_wand/signal_quality.rb', line 5

def to_s
  unit == :dbm ? "#{value} #{unit_label}" : "#{value}#{unit_label}"
end

#unit_labelObject



9
10
11
# File 'lib/wifi_wand/signal_quality.rb', line 9

def unit_label
  unit == :dbm ? 'dBm' : '%'
end