class MotionTrigger

Attributes

location[R]
type[R]

Public Class Methods

new(location: nil) click to toggle source
# File lib/macrohub.rb, line 73
def initialize(location: nil)
  
  @location = location
  @type = :motion
  
end

Public Instance Methods

match?(detail) click to toggle source
# File lib/macrohub.rb, line 80
def match?(detail)

  puts 'inside MotionTrigger#match' if $debug
  location = detail[:location]
  
  if location then
    
    @location.downcase == location.downcase
    
  else
    return false
  end
  
end
to_node() click to toggle source
# File lib/macrohub.rb, line 95
def to_node()
  Rexle::Element.new(:trigger, attributes: {type: :motion, 
                                            location: @location})
end
to_rowx() click to toggle source
# File lib/macrohub.rb, line 100
def to_rowx()
  "trigger: Motion detected in the %s" %  @location
end