Class: SetWifiAction

Inherits:
ConnectivityAction show all
Defined in:
lib/ruby-macrodroid/actions.rb

Overview

Category: Connectivity

Instance Attribute Summary

Attributes inherited from Action

#constraints

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Action

#invoke

Methods included from ObjectX

#action_to_object, #object_create, #varify

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ SetWifiAction

Returns a new instance of SetWifiAction.



601
602
603
604
605
606
607
608
609
610
611
# File 'lib/ruby-macrodroid/actions.rb', line 601

def initialize(h={})

  options = {
    ssid: '[Select Wifi]',
    network_id: 0,
    state: 0
  }

  super(options.merge h)

end

Instance Method Details

#to_s(colour: false, indent: 0) ⇒ Object



613
614
615
616
# File 'lib/ruby-macrodroid/actions.rb', line 613

def to_s(colour: false, indent: 0)
  action = @h[:state] == 0 ? 'Enable' : 'Disable'
  action + ' Wifi'
end