Class: PauseAction
- Inherits:
-
MacroDroidAction
- Object
- MacroObject
- Action
- MacroDroidAction
- 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, indent: 0) ⇒ Object
Methods inherited from Action
Methods included from ObjectX
#action_to_object, #object_create, #varify
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ PauseAction
Returns a new instance of PauseAction.
2063 2064 2065 2066 2067 2068 2069 2070 |
# File 'lib/ruby-macrodroid/actions.rb', line 2063 def initialize(h={}) = { delay_in_milli_seconds: 0, delay_in_seconds: 1, use_alarm: false } super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object
2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 |
# File 'lib/ruby-macrodroid/actions.rb', line 2072 def to_s(colour: false, indent: 0) 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 |