Class: ScaffoldGenerator

Inherits:
VraptorScaffold::Base show all
Defined in:
lib/vraptor-scaffold/generators/scaffold/scaffold_generator.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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_attributesObject

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



8
9
10
# File 'lib/vraptor-scaffold/generators/scaffold/scaffold_generator.rb', line 8

def self.banner
    "vraptor scaffold #{self.arguments.map(&:usage).join(' ')}"
end

Instance Method Details

#client_generatorObject



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_generatorObject



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_generatorObject



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_generatorObject



28
29
30
# File 'lib/vraptor-scaffold/generators/scaffold/scaffold_generator.rb', line 28

def repository_generator
    RepositoryGenerator.new(model, @generated_attributes).build
end