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.
13 14 15 16 17 18 |
# File 'lib/metanorma/cli/template_repo.rb', line 13 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
28 29 30 |
# File 'lib/metanorma/cli/template_repo.rb', line 28 def self.add(name, source, = {}) new(.merge(name: name, source: source)).add end |
Instance Method Details
#add ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/metanorma/cli/template_repo.rb', line 20 def add create_template_config add_new_template(name, source, type) write_to_template_config(templates) templates[:templates] end |