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.



1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
# File 'lib/ruby-macrodroid/constraints.rb', line 1205

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



1216
1217
1218
# File 'lib/ruby-macrodroid/constraints.rb', line 1216

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