Class: Merb::Generators::ModelGenerator
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Generator
#initialize, #with_modules
Class Method Details
.source_root ⇒ Object
5
6
7
|
# File 'lib/merb-gen/model.rb', line 5
def self.source_root
File.join(super, 'model')
end
|
Instance Method Details
#attributes? ⇒ Boolean
55
56
57
|
# File 'lib/merb-gen/model.rb', line 55
def attributes?
self.attributes && !self.attributes.empty?
end
|
#attributes_for_accessor ⇒ Object
59
60
61
|
# File 'lib/merb-gen/model.rb', line 59
def attributes_for_accessor
self.attributes.keys.map{|a| ":#{a}" }.compact.uniq.join(", ")
end
|
#class_name ⇒ Object
43
44
45
|
# File 'lib/merb-gen/model.rb', line 43
def class_name
self.name.camel_case
end
|
#file_name ⇒ Object
51
52
53
|
# File 'lib/merb-gen/model.rb', line 51
def file_name
self.name.snake_case
end
|
#test_class_name ⇒ Object
47
48
49
|
# File 'lib/merb-gen/model.rb', line 47
def test_class_name
self.class_name + "Test"
end
|