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, #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.



4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
# File 'lib/ruby-macrodroid.rb', line 4815

def initialize(h={})

  options = {
    a: true,
    screen_on: true
  }

  super(options.merge h)

end

Instance Method Details

#to_sObject



4826
4827
4828
# File 'lib/ruby-macrodroid.rb', line 4826

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