class LastRunTimeConstraint

Category: MacroDroid Specific

Public Class Methods

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

  options = {
    check_this_macro: false,
    invoked: true,
    macro_ids: [-6922688338672048267],
    macro_names: ["Opendoor"],
    time_period_seconds: 7260
  }

  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 969
def to_s(colour: false, indent: 0)
  
  macro = if @h[:check_this_macro] then
    '[This Macro]'
  end
  
  invoked = @h[:invoked] ? ' Invoked' : 'Not Invoked'
  
  duration = Subunit.seconds(@h[:time_period_seconds]).strfunit("%x")
  "Macro(s) %s\n  %s: %s for %s" % [invoked, macro, invoked, duration]
  
end
Also aliased as: to_summary
to_summary(colour: false, indent: 0)
Alias for: to_s