Class: FuncBot::FunctionGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/func_bot/function_generator.rb

Instance Method Summary collapse

Instance Method Details

#append_to_functions_listObject



9
10
11
12
13
# File 'lib/generators/func_bot/function_generator.rb', line 9

def append_to_functions_list
  yml = YAML.load_file(yml_file)
  yml["functions"] << function_template
  File.write(yml_file, yml.to_yaml.gsub("---\n", ""))
end

#generate_functionObject



5
6
7
# File 'lib/generators/func_bot/function_generator.rb', line 5

def generate_function
  template "function.rb", "app/lib/func_bot/functions/#{file_name}_function.rb"
end