class FaceUpDownConstraint

Category: Sensors

Public Class Methods

new(h={}) click to toggle source
Calls superclass method Constraint::new
# File lib/ruby-macrodroid/constraints.rb, line 1282
def initialize(h={})

  options = {
    option: -1,
    selected_options: [true, false, true, false, false, false]
  }

  super(options.merge h)

end

Public Instance Methods

to_s(colour: false, indent: 0) click to toggle source
# File lib/ruby-macrodroid/constraints.rb, line 1293
def to_s(colour: false, indent: 0)
  a = ['Face Up', 'Face Down', 'Vertical Upright', 'Vertical Upside Down', 
       'Sideways Left', 'Sideways Right']
  s = @h[:selected_options].zip(a).select(&:first).map(&:last).join(', ')

  'Device Facing' + "\n  " + s #+ @h.inspect
end
Also aliased as: to_summary
to_summary(colour: false, indent: 0)
Alias for: to_s