Class: MusicPlayingTrigger
- Inherits:
-
DeviceEventsTrigger
- Object
- MacroObject
- Trigger
- DeviceEventsTrigger
- MusicPlayingTrigger
- Defined in:
- lib/ruby-macrodroid/triggers.rb
Overview
Category: Device Events
Instance Attribute Summary
Attributes inherited from Trigger
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ MusicPlayingTrigger
constructor
A new instance of MusicPlayingTrigger.
- #to_s(colour: false) ⇒ Object
- #to_summary(colour: false) ⇒ Object
Methods inherited from Trigger
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ MusicPlayingTrigger
Returns a new instance of MusicPlayingTrigger.
1013 1014 1015 1016 1017 1018 1019 1020 1021 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1013 def initialize(h={}) = { option: 0 } super(.merge h) end |
Instance Method Details
#to_s(colour: false) ⇒ Object
1023 1024 1025 1026 1027 1028 1029 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1023 def to_s(colour: false) event = @h[:option] == 0 ? 'Started' : 'Stopped' @s = 'Music/Sound Playing' + "\n%s" % event #+ @h.inspect super() end |
#to_summary(colour: false) ⇒ Object
1031 1032 1033 1034 |
# File 'lib/ruby-macrodroid/triggers.rb', line 1031 def to_summary(colour: false) event = @h[:option] == 0 ? 'Started' : 'Stopped' @s = 'Music/Sound Playing' + " (%s)" % event #+ @h.inspect end |