Class: ModelGenerator

Inherits:
BaseScaffold show all
Defined in:
lib/vraptor-scaffold/generators/scaffold/model_generator/model_generator.rb

Instance Method Summary (collapse)

Methods inherited from BaseScaffold

#base_path, #class_name, #controller_class_name, #controller_test_class_name, #controller_test_param, #imports, #initialize, #model_parameter_name, #repository_impl_name, #repository_interface_name, #repository_test_class_name, #test_class_name

Constructor Details

This class inherits a constructor from BaseScaffold

Instance Method Details

- (Object) build



3
4
5
6
7
8
# File 'lib/vraptor-scaffold/generators/scaffold/model_generator/model_generator.rb', line 3

def build
  define_source_paths
  template("model.erb", Configuration.main_class_path(Configuration.models_package, "#{class_name}.java"))
  template("model_test.erb", Configuration.test_class_path(Configuration.models_package, "#{test_class_name}.java"))
  map_orm_class if Configuration.hibernate?
end

- (Object) source_root



14
15
16
# File 'lib/vraptor-scaffold/generators/scaffold/model_generator/model_generator.rb', line 14

def source_root
  File.join File.dirname(__FILE__), "templates"
end

- (Object) template_path



10
11
12
# File 'lib/vraptor-scaffold/generators/scaffold/model_generator/model_generator.rb', line 10

def template_path
  "src/templates/models"
end