Class: Bot::Generators::ResponderGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/bot/responder/responder_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_responderObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/generators/bot/responder/responder_generator.rb', line 6

def create_responder
  create_file "app/bot/responders/#{file_name}.rb", <<-FILE
module Responders
  class #{class_name} < ApplicationResponder
    #
    # def can_handle?
    #   true
    # end
    #
    # def handle
    #   text_response('Hello!')
    # end
    #
  end
end
    FILE
end