Class: SetAirplaneModeAction

Inherits:
ConnectivityAction show all
Defined in:
lib/ruby-macrodroid.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

Returns a new instance of SetAirplaneModeAction.



3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
# File 'lib/ruby-macrodroid.rb', line 3087

def initialize(h={})

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

  super(options.merge h)

end

Instance Method Details

#to_s(colour: false) ⇒ Object



3098
3099
3100
3101
3102
3103
3104
# File 'lib/ruby-macrodroid.rb', line 3098

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