Class: ScreenOnOffConstraint

Inherits:
Constraint show all
Defined in:
lib/ruby-macrodroid/constraints.rb

Overview

Category: Screen and Speaker

Instance Attribute Summary

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Constraint

#match?

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ ScreenOnOffConstraint

Returns a new instance of ScreenOnOffConstraint.



1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
# File 'lib/ruby-macrodroid/constraints.rb', line 1225

def initialize(h={})

  options = {
    a: true,
    screen_on: true
  }

  super(options.merge h)

end

Instance Method Details

#to_s(colour: false, indent: 0) ⇒ Object Also known as: to_summary



1236
1237
1238
# File 'lib/ruby-macrodroid/constraints.rb', line 1236

def to_s(colour: false, indent: 0)
  'Screen ' + (@h[:screen_on] ? 'On' : 'Off')
end