Class: ScaffoldGenerator
- Inherits:
-
VraptorScaffold::Base
- Object
- Thor::Group
- VraptorScaffold::Base
- ScaffoldGenerator
- Defined in:
- lib/vraptor-scaffold/generators/scaffold/scaffold_generator.rb
Instance Attribute Summary collapse
-
#generated_attributes ⇒ Object
Returns the value of attribute generated_attributes.
Class Method Summary collapse
Instance Method Summary collapse
- #client_generator ⇒ Object
- #controller_generator ⇒ Object
-
#initialize(args) ⇒ ScaffoldGenerator
constructor
A new instance of ScaffoldGenerator.
- #model_generator ⇒ Object
- #repository_generator ⇒ Object
Constructor Details
#initialize(args) ⇒ ScaffoldGenerator
Returns a new instance of ScaffoldGenerator.
12 13 14 15 16 17 18 |
# File 'lib/vraptor-scaffold/generators/scaffold/scaffold_generator.rb', line 12 def initialize(args) super(args) @generated_attributes = [] attributes.each { |field, type| @generated_attributes << Attribute.new(field, type) } end |
Instance Attribute Details
#generated_attributes ⇒ Object
Returns the value of attribute generated_attributes.
3 4 5 |
# File 'lib/vraptor-scaffold/generators/scaffold/scaffold_generator.rb', line 3 def generated_attributes @generated_attributes end |
Class Method Details
.banner ⇒ Object
8 9 10 |
# File 'lib/vraptor-scaffold/generators/scaffold/scaffold_generator.rb', line 8 def self. "vraptor scaffold #{self.arguments.map(&:usage).join(' ')}" end |
Instance Method Details
#client_generator ⇒ Object
32 33 34 |
# File 'lib/vraptor-scaffold/generators/scaffold/scaffold_generator.rb', line 32 def client_generator ClientGenerator.new(model, @generated_attributes).build end |
#controller_generator ⇒ Object
20 21 22 |
# File 'lib/vraptor-scaffold/generators/scaffold/scaffold_generator.rb', line 20 def controller_generator ControllerGenerator.new(model, @generated_attributes).build end |
#model_generator ⇒ Object
24 25 26 |
# File 'lib/vraptor-scaffold/generators/scaffold/scaffold_generator.rb', line 24 def model_generator ModelGenerator.new(model, @generated_attributes).build end |
#repository_generator ⇒ Object
28 29 30 |
# File 'lib/vraptor-scaffold/generators/scaffold/scaffold_generator.rb', line 28 def repository_generator RepositoryGenerator.new(model, @generated_attributes).build end |