Module: James
- Defined in:
- lib/james.rb,
lib/james.rb,
lib/james/dialogs.rb,
lib/james/state_api.rb,
lib/james/controller.rb,
lib/james/dialog_api.rb,
lib/james/inputs/base.rb,
lib/james/preferences.rb,
lib/james/conversation.rb,
lib/james/inputs/audio.rb,
lib/james/outputs/audio.rb,
lib/james/markers/marker.rb,
lib/james/markers/memory.rb,
lib/james/inputs/terminal.rb,
lib/james/markers/current.rb,
lib/james/state_internals.rb,
lib/james/dialog_internals.rb,
lib/james/outputs/terminal.rb
Defined Under Namespace
Modules: Dialog, Inputs, Markers, Outputs Classes: Controller, Conversation, Dialogs, Preferences, State
Class Method Summary collapse
-
.controller ⇒ Object
Controller instance.
- .dialog(*args, &block) ⇒ Object
-
.listen(options = {}) ⇒ Object
Start listening.
-
.use(*dialogs) ⇒ Object
Use the given dialogs.
Class Method Details
.controller ⇒ Object
Controller instance.
48 49 50 |
# File 'lib/james.rb', line 48 def self.controller Controller.instance end |
.dialog(*args, &block) ⇒ Object
29 30 31 32 33 34 |
# File 'lib/james/dialog_api.rb', line 29 def dialog *args, &block dialog = Class.new { include James::Dialog } dialog.class_eval &block use dialog.new(*args) dialog end |
.listen(options = {}) ⇒ Object
Start listening.
42 43 44 |
# File 'lib/james.rb', line 42 def self.listen = {} controller.listen end |
.use(*dialogs) ⇒ Object
Use the given dialogs.
If called twice or more, will just add more dialogs.
36 37 38 |
# File 'lib/james.rb', line 36 def self.use *dialogs dialogs.each { |dialog| controller << dialog} end |