Class: Charming::Generators::ScreenGenerator
- Inherits:
-
AppFileGenerator
- Object
- Base
- AppFileGenerator
- Charming::Generators::ScreenGenerator
- Includes:
- AppGenerator::ScreenSpecTemplates
- Defined in:
- lib/charming/generators/screen_generator.rb
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(name, args, out:, destination:, force: false) ⇒ ScreenGenerator
constructor
A new instance of ScreenGenerator.
Methods included from AppGenerator::ScreenSpecTemplates
#spec_controller, #spec_model, #spec_view
Constructor Details
#initialize(name, args, out:, destination:, force: false) ⇒ ScreenGenerator
Returns a new instance of ScreenGenerator.
8 9 10 11 |
# File 'lib/charming/generators/screen_generator.rb', line 8 def initialize(name, args, out:, destination:, force: false) super raise Error, "Usage: charming generate screen NAME" if args.any? end |
Instance Method Details
#generate ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/charming/generators/screen_generator.rb', line 13 def generate create_file(model_path, model) create_file(controller_path, controller) create_file(view_path, view) create_file(spec_model_path, spec_model) create_file(spec_controller_path, spec_controller) create_file(spec_view_path, spec_view) insert_route insert_command end |