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.
1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1698 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
1716 1717 1718 1719 1720 1721 1722 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1716 def to_s(colour: false) @s = 'Media Button Pressed ' #+ @h.inspect @s += "\n" + @h[:option] super() end |