Class: VolumeButtonTrigger
- Inherits:
-
Trigger
- Object
- MacroObject
- Trigger
- VolumeButtonTrigger
- 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(h = {}) ⇒ VolumeButtonTrigger
constructor
A new instance of VolumeButtonTrigger.
- #to_s(colour: false) ⇒ Object
- #to_summary(colour: false) ⇒ Object
Methods inherited from Trigger
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ VolumeButtonTrigger
Returns a new instance of VolumeButtonTrigger.
1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1631 def initialize(h={}) = { dont_change_volume: true, monitor_option: 1, not_configured: false, option: 0 } super(.merge h) end |
Instance Method Details
#to_s(colour: false) ⇒ Object
1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1644 def to_s(colour: false) a = [ 'Volume Up', 'Volume Down', 'Volume Up - Long Press', 'Volume Down - Long Press' ] lines = [a[@h[:option]]] lines << ' ' + (@h[:dont_change_volume] ? 'Retain Previous Volume' : 'Update Volume') @s = lines.join("\n") end |
#to_summary(colour: false) ⇒ Object
1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1658 def to_summary(colour: false) a = [ 'Volume Up', 'Volume Down', 'Volume Up - Long Press', 'Volume Down - Long Press' ] lines = [a[@h[:option]]] lines << (@h[:dont_change_volume] ? 'Retain Previous Volume' : 'Update Volume') @s = lines.join(": ") end |