Class: Metanorma::Processor
- Inherits:
-
Object
- Object
- Metanorma::Processor
- Defined in:
- lib/metanorma/processor.rb
Instance Attribute Summary collapse
-
#input_format ⇒ Object
readonly
Returns the value of attribute input_format.
-
#short ⇒ Object
readonly
Returns the value of attribute short.
Instance Method Summary collapse
- #extract_options(file) ⇒ Object
-
#initialize ⇒ Processor
constructor
A new instance of Processor.
- #input_to_isodoc(file) ⇒ Object
- #output(isodoc_node, outname, format, options = {}) ⇒ Object
- #output_formats ⇒ Object
Constructor Details
#initialize ⇒ Processor
Returns a new instance of Processor.
10 11 12 |
# File 'lib/metanorma/processor.rb', line 10 def initialize raise "This is an abstract class!" end |
Instance Attribute Details
#input_format ⇒ Object (readonly)
Returns the value of attribute input_format.
8 9 10 |
# File 'lib/metanorma/processor.rb', line 8 def input_format @input_format end |
#short ⇒ Object (readonly)
Returns the value of attribute short.
7 8 9 |
# File 'lib/metanorma/processor.rb', line 7 def short @short end |
Instance Method Details
#extract_options(file) ⇒ Object
28 29 30 |
# File 'lib/metanorma/processor.rb', line 28 def (file) Metanorma::Input::Asciidoc.new.(file) end |
#input_to_isodoc(file) ⇒ Object
20 21 22 |
# File 'lib/metanorma/processor.rb', line 20 def input_to_isodoc(file) raise "This is an abstract class!" end |
#output(isodoc_node, outname, format, options = {}) ⇒ Object
24 25 26 |
# File 'lib/metanorma/processor.rb', line 24 def output(isodoc_node, outname, format, ={}) File.open(outname, "w:UTF-8") { |f| f.write(isodoc_node) } end |
#output_formats ⇒ Object
14 15 16 17 18 |
# File 'lib/metanorma/processor.rb', line 14 def output_formats { xml: "xml" } end |