Class: PauseAction
- Inherits:
-
Action
- Object
- MacroObject
- Action
- PauseAction
- Defined in:
- lib/ruby-macrodroid/actions.rb
Instance Attribute Summary
Attributes inherited from Action
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ PauseAction
constructor
A new instance of PauseAction.
- #to_s(colour: false) ⇒ Object
Methods inherited from Action
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ PauseAction
1216 1217 1218 1219 1220 1221 1222 1223 |
# File 'lib/ruby-macrodroid/actions.rb', line 1216 def initialize(h={}) = { delay_in_milli_seconds: 0, delay_in_seconds: 1, use_alarm: false } super(h) end |
Instance Method Details
#to_s(colour: false) ⇒ Object
1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 |
# File 'lib/ruby-macrodroid/actions.rb', line 1225 def to_s(colour: false) su = Subunit.new(units={minutes:60, hours:60}, seconds: @h[:delay_in_seconds]) ms = @h[:delay_in_milli_seconds] duration = if su.to_h.has_key?(:minutes) or (ms < 1) then su.strfunit("%X") else "%s %s ms" % [su.strfunit("%X"), ms] end "Wait " + duration end |