class Alchemy::Generators::IngredientGenerator

Public Instance Methods

copy_templates() click to toggle source
# File lib/generators/alchemy/ingredient/ingredient_generator.rb, line 21
def copy_templates
  @ingredient_editor_local = "#{file_name}_editor"
  @ingredient_view_local = "#{file_name}_view"
  template "view.html.erb", "#{@ingredients_view_path}/_#{file_name}_view.html.erb"
  template "editor.html.erb", "#{@ingredients_view_path}/_#{file_name}_editor.html.erb"
end
create_model() click to toggle source
# File lib/generators/alchemy/ingredient/ingredient_generator.rb, line 17
def create_model
  template "model.rb.tt", "app/models/alchemy/ingredients/#{file_name}.rb"
end
init() click to toggle source
# File lib/generators/alchemy/ingredient/ingredient_generator.rb, line 12
def init
  @class_name = class_name.classify
  @ingredients_view_path = "app/views/alchemy/ingredients"
end
show_todo() click to toggle source
# File lib/generators/alchemy/ingredient/ingredient_generator.rb, line 28
def show_todo
  say "\nPlease check the generated files and alter them to fit your needs."
end

Private Instance Methods

file_name() click to toggle source
# File lib/generators/alchemy/ingredient/ingredient_generator.rb, line 34
def file_name
  @_file_name ||= @class_name.classify.demodulize.underscore
end