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.
1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1473 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
1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1486 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
1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1500 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 |