Class: MusicPlayingTrigger

Inherits:
DeviceEventsTrigger show all
Defined in:
lib/ruby-macrodroid/triggers.rb

Overview

Category: Device Events

Instance Attribute Summary

Attributes inherited from Trigger

#constraints

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Trigger

#match?

Methods inherited from MacroObject

#to_h

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={})

  options = {
    option: 0
  }

  super(options.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