Class: Metanorma::Cli::TemplateRepo
- Inherits:
-
Object
- Object
- Metanorma::Cli::TemplateRepo
- Defined in:
- lib/metanorma/cli/template_repo.rb
Class Method Summary collapse
Instance Method Summary collapse
- #add ⇒ Object
-
#initialize(options = {}) ⇒ TemplateRepo
constructor
A new instance of TemplateRepo.
Constructor Details
#initialize(options = {}) ⇒ TemplateRepo
Returns a new instance of TemplateRepo.
8 9 10 11 12 13 |
# File 'lib/metanorma/cli/template_repo.rb', line 8 def initialize( = {}) @name = .fetch(:name) @source = .fetch(:source) @type = .fetch(:type, "custom") @overwrite = .fetch(:overwrite, false) end |
Class Method Details
.add(name, source, options = {}) ⇒ Object
23 24 25 |
# File 'lib/metanorma/cli/template_repo.rb', line 23 def self.add(name, source, = {}) new(.merge(name: name, source: source)).add end |
Instance Method Details
#add ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/metanorma/cli/template_repo.rb', line 15 def add create_template_config add_new_template(name, source, type) write_to_template_config(templates) templates[:templates] end |