Class: BluetoothConstraint

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

Overview

Category: Connectivity

Instance Attribute Summary

Attributes inherited from MacroObject

#options, #siguid, #type

Instance Method Summary collapse

Methods inherited from Constraint

#match?

Methods inherited from MacroObject

#to_h

Constructor Details

#initialize(h = {}) ⇒ BluetoothConstraint

Returns a new instance of BluetoothConstraint.



4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
# File 'lib/ruby-macrodroid.rb', line 4893

def initialize(h={})

  options = {
    any_device: false,
    bt_state: 0,
    device_name: 'Any Device'
  }

  super(options.merge h)

end

Instance Method Details

#to_s(colour: false) ⇒ Object Also known as: to_summary



4905
4906
4907
4908
# File 'lib/ruby-macrodroid.rb', line 4905

def to_s(colour: false)
  device = @h[:device_name] #== 'Any Device' ? 'Any' : @h[:device_name]
  "Device Connected (%s)" % device
end