Class: PauseAction
- Inherits:
-
Action
- Object
- MacroObject
- Action
- PauseAction
- Defined in:
- lib/ruby-macrodroid.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 ⇒ Object
Methods inherited from Action
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ PauseAction
Returns a new instance of PauseAction.
3402 3403 3404 3405 3406 3407 3408 3409 |
# File 'lib/ruby-macrodroid.rb', line 3402 def initialize(h={}) = { delay_in_milli_seconds: 0, delay_in_seconds: 1, use_alarm: false } super(h) end |
Instance Method Details
#to_s ⇒ Object
3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 |
# File 'lib/ruby-macrodroid.rb', line 3411 def to_s() 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 |