Class: MediaButtonPressedTrigger
- Inherits:
-
Trigger
- Object
- MacroObject
- Trigger
- MediaButtonPressedTrigger
- Defined in:
- lib/ruby-macrodroid/triggers.rb
Overview
Category: User Input
Instance Attribute Summary
Attributes inherited from Trigger
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(obj = nil) ⇒ MediaButtonPressedTrigger
constructor
A new instance of MediaButtonPressedTrigger.
- #to_s(colour: false) ⇒ Object (also: #to_summary)
Methods inherited from Trigger
Methods inherited from MacroObject
Constructor Details
#initialize(obj = nil) ⇒ MediaButtonPressedTrigger
Returns a new instance of MediaButtonPressedTrigger.
1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1694 def initialize(obj=nil) h = if obj.is_a? Hash then obj elsif obj.is_a? Array e, macro = obj {option: e.text('item/description').to_s} end = { option: 'Single Press', cancel_press: false } super(.merge h) end |
Instance Method Details
#to_s(colour: false) ⇒ Object Also known as: to_summary
1712 1713 1714 1715 1716 1717 1718 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1712 def to_s(colour: false) @s = 'Media Button Pressed ' #+ @h.inspect @s += "\n" + @h[:option] super() end |