Class: ProjectSimulator::MotionTrigger
- Inherits:
-
Object
- Object
- ProjectSimulator::MotionTrigger
- Defined in:
- lib/projectsimulator.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
Instance Method Summary collapse
-
#initialize(locationx, location: locationx) ⇒ MotionTrigger
constructor
A new instance of MotionTrigger.
- #match ⇒ Object
- #to_node ⇒ Object
- #to_rowx ⇒ Object
Constructor Details
#initialize(locationx, location: locationx) ⇒ MotionTrigger
Returns a new instance of MotionTrigger.
368 369 370 |
# File 'lib/projectsimulator.rb', line 368 def initialize(locationx, location: locationx) @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
366 367 368 |
# File 'lib/projectsimulator.rb', line 366 def location @location end |
Instance Method Details
#match ⇒ Object
372 373 374 |
# File 'lib/projectsimulator.rb', line 372 def match() @location.downcase == location.downcase end |
#to_node ⇒ Object
376 377 378 379 |
# File 'lib/projectsimulator.rb', line 376 def to_node() Rexle::Element.new(:trigger, \ attributes: {type: :motion, location: @location}) end |
#to_rowx ⇒ Object
381 382 383 |
# File 'lib/projectsimulator.rb', line 381 def to_rowx() "trigger: Motion detected in the %s" % @location end |