Class: Kybus::CLI::Bot::BotGenerator

Inherits:
FileProvider show all
Defined in:
lib/kybus/cli/bot/file_providers/bot_generator.rb

Instance Method Summary collapse

Methods inherited from FileProvider

autoregister!, #bot_name, #bot_name_class, #bot_name_constantize, #bot_name_snake_case, #generate, #initialize, #keep_files, #skip_file?

Constructor Details

This class inherits a constructor from Kybus::CLI::Bot::FileProvider

Instance Method Details

#make_contentsObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/kybus/cli/bot/file_providers/bot_generator.rb', line 12

def make_contents
  "    # frozen_string_literal: true\n\n    class \#{bot_name_class} < Kybus::Bot::Base\n      def initialize(configs)\n        super(configs)\n        register_command('/hello') do\n          send_message('Hi human')\n        end\n      end\n    end\n  RUBY\nend\n"

#saving_pathObject



8
9
10
# File 'lib/kybus/cli/bot/file_providers/bot_generator.rb', line 8

def saving_path
  'bot.rb'
end