Class: Cogibara::OperatorBase
- Inherits:
-
Object
- Object
- Cogibara::OperatorBase
- Defined in:
- lib/cogibara/operator_base.rb
Direct Known Subclasses
Calendar, Chat, Help, Knowledge, ReminderSetter, SoftParser, Translate, Weather, Wiki, WolframAlpha
Instance Attribute Summary collapse
-
#clientID ⇒ Object
readonly
Returns the value of attribute clientID.
-
#message_structure ⇒ Object
readonly
Returns the value of attribute message_structure.
-
#message_text ⇒ Object
readonly
Returns the value of attribute message_text.
-
#operator_config ⇒ Object
readonly
Returns the value of attribute operator_config.
Instance Method Summary collapse
- #confirm(message, success = nil, failure = nil) ⇒ Object
-
#initialize(config = {}) ⇒ OperatorBase
constructor
A new instance of OperatorBase.
- #process(message) ⇒ Object
- #process_file(file) ⇒ Object
- #receive_message(message) ⇒ Object
- #say(message) ⇒ Object
Constructor Details
#initialize(config = {}) ⇒ OperatorBase
Returns a new instance of OperatorBase.
9 10 11 12 |
# File 'lib/cogibara/operator_base.rb', line 9 def initialize(config={}) @operator_config = config initialize_operator if self.respond_to?(:initialize_operator) end |
Instance Attribute Details
#clientID ⇒ Object (readonly)
Returns the value of attribute clientID.
4 5 6 |
# File 'lib/cogibara/operator_base.rb', line 4 def clientID @clientID end |
#message_structure ⇒ Object (readonly)
Returns the value of attribute message_structure.
6 7 8 |
# File 'lib/cogibara/operator_base.rb', line 6 def @message_structure end |
#message_text ⇒ Object (readonly)
Returns the value of attribute message_text.
5 6 7 |
# File 'lib/cogibara/operator_base.rb', line 5 def @message_text end |
#operator_config ⇒ Object (readonly)
Returns the value of attribute operator_config.
7 8 9 |
# File 'lib/cogibara/operator_base.rb', line 7 def operator_config @operator_config end |
Instance Method Details
#confirm(message, success = nil, failure = nil) ⇒ Object
33 34 35 36 37 |
# File 'lib/cogibara/operator_base.rb', line 33 def confirm(, success=nil, failure=nil) puts "new confirm" Cogibara::confirmer.add_action(, success) end |
#process(message) ⇒ Object
21 22 23 |
# File 'lib/cogibara/operator_base.rb', line 21 def process() "!!!text processing not implemented for this operator!!!" end |
#process_file(file) ⇒ Object
25 26 27 |
# File 'lib/cogibara/operator_base.rb', line 25 def process_file(file) "!!!file processing not implemented for this operator!!!" end |
#receive_message(message) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/cogibara/operator_base.rb', line 14 def () @clientID = .clientID @message_text = .text @message_structure = .structure process() end |