class WifiConstraint
Category: Connectivity
Public Class Methods
new(h={})
click to toggle source
Calls superclass method
Constraint::new
# File lib/ruby-macrodroid/constraints.rb, line 290 def initialize(h={}) options = { ssid_list: [], wifi_state: 0 } super(options.merge h) end
Public Instance Methods
to_s(colour: false, indent: 0)
click to toggle source
# File lib/ruby-macrodroid/constraints.rb, line 301 def to_s(colour: false, indent: 0) state = ['Enabled','Disabled','Connected', 'Not Connected'][@h[:wifi_state]] @s = 'Wifi ' + state + ': ' if @h[:ssid_list].length > 1 then @s += "[%s]" % @h[:ssid_list].join(', ') elsif @h[:ssid_list].length > 0 @s += @h[:ssid_list].first end end
Also aliased as: to_summary