Sha256: e63df3aa31a4b68826b4d72b13752df4c5fe0ffe9a00dd4b304753246beee7e1

Contents?: true

Size: 486 Bytes

Versions: 2

Compression:

Stored size: 486 Bytes

Contents

module Chatterbot

  #
  # bot template generator
  class Skeleton
    class << self

      #
      # generate a template file for the specified bot
      # @param [Bot] bot object
      #
      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
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
chatterbot-2.2.0 lib/chatterbot/skeleton.rb
chatterbot-2.1.0 lib/chatterbot/skeleton.rb