I would like to generate complete classes in Ruby, that extend other classes. For example, I have my function:
def generator(classname, methodname, ModelClass)
# make the class
# now make the instance method on the class
end
and calling it generates a class like below:
generator 'ArticlesController' 'save' 'Article'
class ArticlesController < ApplicationController
def save
@generated_params = # generate params from Article
@item = Article.new(@generated_params)
@item.save
end
end
except that I can make new classes based on some input.