Class: StopWatchConstraint

Inherits:
Constraint show all
Defined in:
lib/ruby-macrodroid/constraints.rb

Overview

Category: Date/Time

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 = {}) ⇒ StopWatchConstraint

Returns a new instance of StopWatchConstraint.



459
460
461
462
463
464
465
466
467
# File 'lib/ruby-macrodroid/constraints.rb', line 459

def initialize(h={})

  options = {
    days_of_week: [false, false, true, false, false, false, false]
  }

  super(options.merge h)

end

Instance Method Details

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



469
470
471
472
473
# File 'lib/ruby-macrodroid/constraints.rb', line 469

def to_s(colour: false, indent: 0)
  #'StopWatchConstraint ' + @h.inspect
  operator = @h[:greater_than] ? '>' : '<'
  "%s %s %s" % [@h[:stopwatch_name], operator, @h[:variable_name] ] #+ @h.inspect
end