Class: Shaf::Generator::Scaffold
- Defined in:
- lib/shaf/generator/scaffold.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
identified_by, identifier, #identifier, inherited, #initialize, options, usage
Constructor Details
This class inherits a constructor from Shaf::Generator::Base
Instance Method Details
#call ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/shaf/generator/scaffold.rb', line 8 def call check_name_arg! [:specs] = true if [:specs].nil? Generator::Factory.create('model', *args, **).call Generator::Factory.create('controller', *args, **).call end |
#check_name_arg! ⇒ Object
16 17 18 19 20 21 |
# File 'lib/shaf/generator/scaffold.rb', line 16 def check_name_arg! return if args.first && !args.first.empty? raise Command::ArgumentError, "Please provide a name when using the scaffold generator!" end |