Class: ActiveApplicationConstraint
- Inherits:
-
Constraint
- Object
- MacroObject
- Constraint
- ActiveApplicationConstraint
- Defined in:
- lib/ruby-macrodroid/constraints.rb
Overview
Category: application
Instance Attribute Summary
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ ActiveApplicationConstraint
constructor
A new instance of ActiveApplicationConstraint.
- #to_s(colour: false, indent: 0) ⇒ Object
- #to_summary(colour: false, indent: 0) ⇒ Object
Methods inherited from Constraint
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ ActiveApplicationConstraint
Returns a new instance of ActiveApplicationConstraint.
65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/ruby-macrodroid/constraints.rb', line 65 def initialize(h={}) = { :application_name_list=>["YouTube"], :foreground=>true, :package_name_list=>["com.google.android.youtube"] } super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object
77 78 79 80 81 82 83 |
# File 'lib/ruby-macrodroid/constraints.rb', line 77 def to_s(colour: false, indent: 0) indentx = ' ' * indent mode = @h[:foreground] ? 'foreground' : 'not foreground' apps = @h[:application_name_list] indentx + 'App ' + mode + "\n " + indentx + apps.join(', ') #+ @h.inspect end |
#to_summary(colour: false, indent: 0) ⇒ Object
85 86 87 88 89 90 |
# File 'lib/ruby-macrodroid/constraints.rb', line 85 def to_summary(colour: false, indent: 0) mode = @h[:foreground] ? 'foreground' : 'not foreground' apps = @h[:application_name_list] 'App ' + mode + " (%s)" % apps.join(', ') #+ @h.inspect end |