Class: SayAction
- Inherits:
-
Object
- Object
- SayAction
- 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
-
#initialize(s = nil, msg: s) ⇒ SayAction
constructor
A new instance of SayAction.
- #invoke ⇒ Object
- #to_node ⇒ Object
- #to_rowx ⇒ Object
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
#invoke ⇒ Object
29 30 31 |
# File 'lib/macrohub.rb', line 29 def invoke() "say: %s" % @s end |
#to_node ⇒ Object
33 34 35 |
# File 'lib/macrohub.rb', line 33 def to_node() Rexle::Element.new(:action, attributes: {type: :say, text: @s}) end |
#to_rowx ⇒ Object
37 38 39 |
# File 'lib/macrohub.rb', line 37 def to_rowx() "action: say '%s'" % @s end |