Class: LastRunTimeConstraint
- Inherits:
-
Constraint
- Object
- MacroObject
- Constraint
- LastRunTimeConstraint
- Defined in:
- lib/ruby-macrodroid/constraints.rb
Overview
Category: MacroDroid Specific
Instance Attribute Summary
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ LastRunTimeConstraint
constructor
A new instance of LastRunTimeConstraint.
- #to_s(colour: false, indent: 0) ⇒ Object (also: #to_summary)
Methods inherited from Constraint
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ LastRunTimeConstraint
Returns a new instance of LastRunTimeConstraint.
924 925 926 927 928 929 930 931 932 933 934 935 936 |
# File 'lib/ruby-macrodroid/constraints.rb', line 924 def initialize(h={}) = { check_this_macro: false, invoked: true, macro_ids: [-6922688338672048267], macro_names: ["Opendoor"], time_period_seconds: 7260 } super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object Also known as: to_summary
938 939 940 941 942 943 944 945 946 947 948 949 |
# File 'lib/ruby-macrodroid/constraints.rb', line 938 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 |