Class: RBCliTool::Generator
- Inherits:
-
Object
- Object
- RBCliTool::Generator
- Defined in:
- lib/rbcli-tool/generators.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type = nil, root_path = nil, template_vars = {}) ⇒ Generator
constructor
A new instance of Generator.
- #run(*args) ⇒ Object
Constructor Details
#initialize(type = nil, root_path = nil, template_vars = {}) ⇒ Generator
Returns a new instance of Generator.
28 29 30 |
# File 'lib/rbcli-tool/generators.rb', line 28 def initialize type = nil, root_path = nil, template_vars = {} @generator = @@types[type.to_s.downcase].new root_path, template_vars end |
Class Method Details
.inherited(subklass) ⇒ Object
23 24 25 26 |
# File 'lib/rbcli-tool/generators.rb', line 23 def self.inherited(subklass) @@types ||= {} @@types[subklass.name.downcase.split('::')[1]] = subklass end |
Instance Method Details
#run(*args) ⇒ Object
32 33 34 |
# File 'lib/rbcli-tool/generators.rb', line 32 def run *args @generator.run *args end |