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.
955 956 957 958 959 960 961 962 963 964 965 966 967 |
# File 'lib/ruby-macrodroid/constraints.rb', line 955 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
969 970 971 972 973 974 975 976 977 978 979 980 |
# 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 |