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.
1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1585 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
1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1598 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
1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1612 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 |