Class: Nrb::Commands::Generate
- Defined in:
- lib/nrb/commands/generate.rb
Overview
This command generates a resource, and if it is a model, it also generates the correspnding create migration file.
Instance Method Summary collapse
Methods inherited from Resource
#ensure_valid_resource, valid_resources
Methods inherited from Inside
Methods inherited from Base
Instance Method Details
#generate_resource ⇒ Object
8 9 10 11 |
# File 'lib/nrb/commands/generate.rb', line 8 def generate_resource template "templates/#{resource}.rb.tt", target("#{name.underscore}.rb"), opts.merge(name: name.camelize) end |