Class: SetAirplaneModeAction

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 = {}) ⇒ SetAirplaneModeAction

Returns a new instance of SetAirplaneModeAction.



790
791
792
793
794
795
796
797
798
799
# File 'lib/ruby-macrodroid/actions.rb', line 790

def initialize(h={})

  options = {
    device_name: '',
    state: 1
  }

  super(options.merge h)

end

Instance Method Details

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



801
802
803
804
805
806
807
# File 'lib/ruby-macrodroid/actions.rb', line 801

def to_s(colour: false, indent: 0)
  
  state = ['On', 'Off', 'Toggle'][@h[:state]]
  @s = 'Airplane Mode ' + state
  super()
  
end