Class: MusicActiveConstraint
- Inherits:
-
Constraint
- Object
- MacroObject
- Constraint
- MusicActiveConstraint
- Defined in:
- lib/ruby-macrodroid/constraints.rb
Overview
Category: Media
Instance Attribute Summary
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ MusicActiveConstraint
constructor
A new instance of MusicActiveConstraint.
- #to_s(colour: false, indent: 0) ⇒ Object (also: #to_summary)
Methods inherited from Constraint
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ MusicActiveConstraint
Returns a new instance of MusicActiveConstraint.
1012 1013 1014 1015 1016 1017 1018 1019 1020 |
# File 'lib/ruby-macrodroid/constraints.rb', line 1012 def initialize(h={}) = { music_active: true } super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object Also known as: to_summary
1022 1023 1024 1025 |
# File 'lib/ruby-macrodroid/constraints.rb', line 1022 def to_s(colour: false, indent: 0) active = @h[:music_active] ? 'Playing' : 'Stopped' 'Music ' + active #+ @h.inspect end |