Class: Twilio::Rails::PhoneTreeGenerator

Inherits:
Rails::Generators::NamedBase
  • Object
show all
Defined in:
lib/generators/twilio/rails/phone_tree/phone_tree_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_template_treeObject



5
6
7
# File 'lib/generators/twilio/rails/phone_tree/phone_tree_generator.rb', line 5

def copy_template_tree
  template "tree.rb.erb", "app/phone_trees/#{file_name}_tree.rb"
end

#register_treeObject



9
10
11
# File 'lib/generators/twilio/rails/phone_tree/phone_tree_generator.rb', line 9

def register_tree
  insert_into_file "config/initializers/twilio_rails.rb", "\n  config.phone_trees.register { #{class_name}Tree }", before: "\nend\n"
end