Class: PowerButtonToggleTrigger
- Inherits:
-
Trigger
- Object
- MacroObject
- Trigger
- PowerButtonToggleTrigger
- Defined in:
- lib/ruby-macrodroid/triggers.rb
Overview
Category: Battery/Power
Instance Attribute Summary
Attributes inherited from Trigger
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ PowerButtonToggleTrigger
constructor
A new instance of PowerButtonToggleTrigger.
- #match?(detail = {}, model = nil) ⇒ Boolean
- #to_s(colour: false) ⇒ Object (also: #to_summary)
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ PowerButtonToggleTrigger
Returns a new instance of PowerButtonToggleTrigger.
209 210 211 212 213 214 215 216 217 |
# File 'lib/ruby-macrodroid/triggers.rb', line 209 def initialize(h={}) = { num_toggles: 3 } super(.merge h) end |
Instance Method Details
#match?(detail = {}, model = nil) ⇒ Boolean
219 220 221 |
# File 'lib/ruby-macrodroid/triggers.rb', line 219 def match?(detail={}, model=nil) @h[:num_toggles] == detail[:num_toggles].to_i end |
#to_s(colour: false) ⇒ Object Also known as: to_summary
223 224 225 |
# File 'lib/ruby-macrodroid/triggers.rb', line 223 def to_s(colour: false) "Power Button Toggle (%s)" % @h[:num_toggles] #+ @h.inspect end |