Class: DeviceLockedConstraint

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

Overview

Category: Device State

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

Returns a new instance of DeviceLockedConstraint.



5304
5305
5306
5307
5308
5309
5310
5311
5312
# File 'lib/ruby-macrodroid.rb', line 5304

def initialize(h={})

  options = {
    locked: true
  }

  super(options.merge h)

end

Instance Method Details

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



5314
5315
5316
# File 'lib/ruby-macrodroid.rb', line 5314

def to_s(colour: false)
  'Device ' + (@h[:locked] ? 'Locked' : 'Unlocked')
end