Class: StopWatchAction
- Inherits:
-
DateTimeAction
- Object
- MacroObject
- Action
- DateTimeAction
- StopWatchAction
- Defined in:
- lib/ruby-macrodroid/actions.rb
Overview
Category: Date/Time
Instance Attribute Summary
Attributes inherited from Action
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ StopWatchAction
constructor
A new instance of StopWatchAction.
- #to_s(colour: false, indent: 0) ⇒ Object (also: #to_summary)
Methods inherited from Action
Methods included from ObjectX
#action_to_object, #object_create, #varify
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ StopWatchAction
Returns a new instance of StopWatchAction.
981 982 983 984 985 986 987 988 989 990 |
# File 'lib/ruby-macrodroid/actions.rb', line 981 def initialize(h={}) = { stopwatch_name: 'timer1', option: 0 } super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object Also known as: to_summary
992 993 994 995 996 997 |
# File 'lib/ruby-macrodroid/actions.rb', line 992 def to_s(colour: false, indent: 0) option = ['Start', 'Pause','Reset','Reset and Restart'][@h[:option]] name = @h[:stopwatch_name] @s = "StopWatch (%s)" % option + "\n" + name #+ ' ' + @h.inspect super() end |