Class: BluetoothConstraint
- Inherits:
-
Constraint
- Object
- MacroObject
- Constraint
- BluetoothConstraint
- Defined in:
- lib/ruby-macrodroid/constraints.rb
Overview
Category: Connectivity
Instance Attribute Summary
Attributes inherited from MacroObject
Instance Method Summary collapse
-
#initialize(h = {}) ⇒ BluetoothConstraint
constructor
A new instance of BluetoothConstraint.
- #to_s(colour: false, indent: 0) ⇒ Object
- #to_summary(colour: false) ⇒ Object
Methods inherited from Constraint
Methods inherited from MacroObject
Constructor Details
#initialize(h = {}) ⇒ BluetoothConstraint
Returns a new instance of BluetoothConstraint.
198 199 200 201 202 203 204 205 206 207 208 |
# File 'lib/ruby-macrodroid/constraints.rb', line 198 def initialize(h={}) = { any_device: false, bt_state: 0, device_name: 'Any Device' } super(.merge h) end |
Instance Method Details
#to_s(colour: false, indent: 0) ⇒ Object
210 211 212 213 |
# File 'lib/ruby-macrodroid/constraints.rb', line 210 def to_s(colour: false, indent: 0) device = @h[:device_name] #== 'Any Device' ? 'Any' : @h[:device_name] "Device Connected\n %s" % device end |
#to_summary(colour: false) ⇒ Object
215 216 217 218 |
# File 'lib/ruby-macrodroid/constraints.rb', line 215 def to_summary(colour: false) device = @h[:device_name] #== 'Any Device' ? 'Any' : @h[:device_name] "Device Connected (%s)" % device end |