class Stealth::Generators::Generate
Public Class Methods
source_root()
click to toggle source
# File lib/stealth/generators/generate.rb, line 14 def self.source_root File.dirname(__FILE__) + "/generate/flow" end
Public Instance Methods
create_controller()
click to toggle source
# File lib/stealth/generators/generate.rb, line 18 def create_controller template('controllers/controller.tt', "bot/controllers/#{name.pluralize}_controller.rb") end
create_helper()
click to toggle source
# File lib/stealth/generators/generate.rb, line 27 def create_helper template('helpers/helper.tt', "bot/helpers/#{name}_helper.rb") end
create_replies()
click to toggle source
# File lib/stealth/generators/generate.rb, line 22 def create_replies # Sample Ask Reply template('replies/ask_example.tt', "bot/replies/#{name.pluralize}/ask_example.yml.erb") end
edit_flow_map()
click to toggle source
# File lib/stealth/generators/generate.rb, line 31 def edit_flow_map inject_into_file "config/flow_map.rb", after: "include Stealth::Flow\n" do "\n\tflow :#{name} do\n\t\tstate :ask_example\n\tend\n" end end