Class: Metanorma::Cli::Collection

Inherits:
Object
  • Object
show all
Defined in:
lib/metanorma/cli/collection.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, options) ⇒ Collection

Returns a new instance of Collection.



6
7
8
9
10
11
# File 'lib/metanorma/cli/collection.rb', line 6

def initialize(file, options)
  @file = file
  @options = Cli.with_indifferent_access(options)
  @output_dir = @options.delete(:output_dir)
  @compile_options = @options.delete(:compile)
end

Class Method Details

.render(filename, options = {}) ⇒ Object



13
14
15
# File 'lib/metanorma/cli/collection.rb', line 13

def self.render(filename, options = {})
  new(filename, options).render
end

Instance Method Details

#renderObject



17
18
19
20
# File 'lib/metanorma/cli/collection.rb', line 17

def render
  extract_options_from_file
  collection_file.render(collection_options.compact)
end