Class: SayAction

Inherits:
Object
  • Object
show all
Defined in:
lib/macrohub.rb

Overview

This file includes the following classes:

* SayAction
* WebhookAction
* MotionTrigger
* FrequencyConstraint
* TimeConstraint
* TriggersNlp    - selects the trigger to use
* ActionsNlp     - selects the action to use
* ConstraintsNlp - selects the constraint to use
* Macro    - contains the triggers, actions, and constraints
* MacroHub - contains the macros

Instance Method Summary collapse

Constructor Details

#initialize(s = nil, msg: s) ⇒ SayAction

Returns a new instance of SayAction.



25
26
27
# File 'lib/macrohub.rb', line 25

def initialize(s=nil, msg: s)
  @s  = msg
end

Instance Method Details

#invokeObject



29
30
31
# File 'lib/macrohub.rb', line 29

def invoke()
  "say: %s" % @s
end

#to_nodeObject



33
34
35
# File 'lib/macrohub.rb', line 33

def to_node()
  Rexle::Element.new(:action, attributes: {type: :say, text: @s})
end

#to_rowxObject



37
38
39
# File 'lib/macrohub.rb', line 37

def to_rowx()
  "action: say '%s'" %  @s
end