Class: Jambots::Controllers::NewController
- Inherits:
-
Object
- Object
- Jambots::Controllers::NewController
- Defined in:
- lib/jambots/controllers/new_controller.rb
Instance Method Summary collapse
- #create_bot(name) ⇒ Object
-
#initialize(options) ⇒ NewController
constructor
A new instance of NewController.
Constructor Details
#initialize(options) ⇒ NewController
Returns a new instance of NewController.
6 7 8 |
# File 'lib/jambots/controllers/new_controller.rb', line 6 def initialize() @options = end |
Instance Method Details
#create_bot(name) ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/jambots/controllers/new_controller.rb', line 10 def create_bot(name) path = Jambots::Bot.find_path(@options[:path]) model = @options[:model] || Jambots::Bot::DEFAULT_MODEL prompt = @options[:prompt] Jambots::Bot.create(name, path: path, model: model, prompt: prompt) puts "Bot '#{name}' created in '#{path}/#{name}'" end |