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.
1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1677 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
1695 1696 1697 1698 1699 1700 1701 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1695 def to_s(colour: false) @s = 'Media Button Pressed ' #+ @h.inspect @s += "\n" + @h[:option] super() end |