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 inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ SetAirplaneModeAction



368
369
370
371
372
373
374
375
376
377
# File 'lib/ruby-macrodroid/actions.rb', line 368

def initialize(h={})

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

  super(options.merge h)

end

Instance Method Details

#to_s(colour: false) ⇒ Object



379
380
381
382
383
384
385
# File 'lib/ruby-macrodroid/actions.rb', line 379

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