Class: Ritsu::ProjectGenerator
- Inherits:
-
Object
- Object
- Ritsu::ProjectGenerator
show all
- Defined in:
- lib/ritsu/project_generator.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ProjectGenerator.
17
18
19
20
21
22
|
# File 'lib/ritsu/project_generator.rb', line 17
def initialize(name)
if !ProjectGenerator.is_valid_generator_name?(name)
raise ArgumentError.new("'#{name}' is not a valid project name (i.e., a C name)")
end
@name = name
end
|
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
7
8
9
|
# File 'lib/ritsu/project_generator.rb', line 7
def name
@name
end
|
Class Method Details
.generator_classes ⇒ Object
9
10
11
|
# File 'lib/ritsu/project_generator.rb', line 9
def self.generator_classes
@generator_classes ||= {}
end
|
.is_valid_generator_name?(name) ⇒ Boolean
.validate_instance(instance) ⇒ Object
24
25
26
27
28
|
# File 'lib/ritsu/project_generator.rb', line 24
def self.validate_instance(instance)
if instances.select { |x| x.name == instance.name }.length > 0
raise ArgumentError.new("project generator with name '#{instance.name}' already exists")
end
end
|
Instance Method Details
#generate(*args) ⇒ Object
30
31
32
|
# File 'lib/ritsu/project_generator.rb', line 30
def generate(*args)
raise NotImplementedError.new
end
|