class ActiveApplicationConstraint

Category: application

Public Class Methods

new(h={}) click to toggle source
Calls superclass method Constraint::new
# File lib/ruby-macrodroid/constraints.rb, line 65
def initialize(h={})

  options = {
    :application_name_list=>["YouTube"], 
    :foreground=>true, 
    :package_name_list=>["com.google.android.youtube"]      
  }

  super(options.merge h)

end

Public Instance Methods

to_s(colour: false, indent: 0) click to toggle source
# 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) click to toggle source
# 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