Class: Metanorma::Cli::Collection
- Inherits:
-
Object
- Object
- Metanorma::Cli::Collection
- Defined in:
- lib/metanorma/cli/collection.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
- #collection_file ⇒ Object
-
#initialize(file, options) ⇒ Collection
constructor
A new instance of Collection.
- #render ⇒ Object
Constructor Details
#initialize(file, options) ⇒ Collection
Returns a new instance of Collection.
8 9 10 11 12 13 |
# File 'lib/metanorma/cli/collection.rb', line 8 def initialize(file, ) @file = file @options = Cli.with_indifferent_access() @output_dir = @options.delete(:output_dir) @compile_options = @options.delete(:compile) end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
6 7 8 |
# File 'lib/metanorma/cli/collection.rb', line 6 def file @file end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
6 7 8 |
# File 'lib/metanorma/cli/collection.rb', line 6 def @options end |
Class Method Details
.render(filename, options = {}) ⇒ Object
15 16 17 |
# File 'lib/metanorma/cli/collection.rb', line 15 def self.render(filename, = {}) new(filename, ).render end |
Instance Method Details
#collection_file ⇒ Object
25 26 27 |
# File 'lib/metanorma/cli/collection.rb', line 25 def collection_file @collection_file ||= Metanorma::Collection.parse(file) end |
#render ⇒ Object
19 20 21 22 23 |
# File 'lib/metanorma/cli/collection.rb', line 19 def render collection_file.render(.compact) self end |