class Chatterbot::Skeleton

bot template generator

Public Class Methods

generate(bot) click to toggle source

generate a template file for the specified bot @param [Bot] bot object

# File lib/chatterbot/skeleton.rb, line 12
def generate(bot)
  path = File.join(Chatterbot.libdir, "..", "templates", "skeleton.txt")
  src = File.read(path)

  opts = bot.config.to_h.merge({
    :name => bot.botname,
    :timestamp => Time.now
  })

  src % opts
end