Class: ScreenOnOffConstraint

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



5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
# File 'lib/ruby-macrodroid.rb', line 5805

def initialize(h={})

  options = {
    a: true,
    screen_on: true
  }

  super(options.merge h)

end

Instance Method Details

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



5816
5817
5818
# File 'lib/ruby-macrodroid.rb', line 5816

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