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.



1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
# File 'lib/ruby-macrodroid/constraints.rb', line 1236

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



1247
1248
1249
# File 'lib/ruby-macrodroid/constraints.rb', line 1247

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