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.
1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1648 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
1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1661 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
1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1675 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 |