Class: BaseScaffold

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

Instance Method Summary collapse

Constructor Details

#initialize(model, attributes = {}) ⇒ BaseScaffold

Returns a new instance of BaseScaffold.



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

def initialize(model, attributes={})
  super
  @model = model
  @attributes = attributes
end

Instance Method Details

#base_pathObject



45
46
47
# File 'lib/vraptor-scaffold/generators/scaffold/base_scaffold.rb', line 45

def base_path
  model_parameter_name.pluralize
end

#class_nameObject



13
14
15
# File 'lib/vraptor-scaffold/generators/scaffold/base_scaffold.rb', line 13

def class_name
  @model.camelize
end

#controller_class_nameObject



37
38
39
# File 'lib/vraptor-scaffold/generators/scaffold/base_scaffold.rb', line 37

def controller_class_name
  "#{class_name}Controller"
end

#controller_test_class_nameObject



41
42
43
# File 'lib/vraptor-scaffold/generators/scaffold/base_scaffold.rb', line 41

def controller_test_class_name
  "#{controller_class_name}Test"
end

#model_list_nameObject



17
18
19
# File 'lib/vraptor-scaffold/generators/scaffold/base_scaffold.rb', line 17

def model_list_name
  model_parameter_name.pluralize
end

#model_parameter_nameObject



9
10
11
# File 'lib/vraptor-scaffold/generators/scaffold/base_scaffold.rb', line 9

def model_parameter_name
  @model.camelize(:lower)
end

#repository_impl_nameObject



29
30
31
# File 'lib/vraptor-scaffold/generators/scaffold/base_scaffold.rb', line 29

def repository_impl_name
  "#{repository_interface_name}Impl"
end

#repository_interface_nameObject



25
26
27
# File 'lib/vraptor-scaffold/generators/scaffold/base_scaffold.rb', line 25

def repository_interface_name
  "#{class_name}Repository"
end

#repository_test_class_nameObject



33
34
35
# File 'lib/vraptor-scaffold/generators/scaffold/base_scaffold.rb', line 33

def repository_test_class_name
  "#{repository_impl_name}Test"
end

#test_class_nameObject



21
22
23
# File 'lib/vraptor-scaffold/generators/scaffold/base_scaffold.rb', line 21

def test_class_name
  "#{class_name}Test"
end