Class: FuncBot::FunctionGenerator
- Inherits:
-
Rails::Generators::NamedBase
- Object
- Rails::Generators::NamedBase
- FuncBot::FunctionGenerator
- Defined in:
- lib/generators/func_bot/function_generator.rb
Instance Method Summary collapse
Instance Method Details
#append_to_functions_list ⇒ Object
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_function ⇒ Object
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 |