Class: Relaton::Cli::BaseConvertor
- Inherits:
-
Object
- Object
- Relaton::Cli::BaseConvertor
- Defined in:
- lib/relaton/cli/base_convertor.rb
Direct Known Subclasses
Class Method Summary collapse
-
.to_html(file, style, template) ⇒ Object
Convert to HTML.
Instance Method Summary collapse
-
#initialize(file, options = {}) ⇒ BaseConvertor
constructor
A new instance of BaseConvertor.
- #to_html ⇒ Object
Constructor Details
#initialize(file, options = {}) ⇒ BaseConvertor
Returns a new instance of BaseConvertor.
9 10 11 12 13 14 15 16 |
# File 'lib/relaton/cli/base_convertor.rb', line 9 def initialize(file, = {}) @file = file = @outdir = .fetch(:outdir, nil) @writable = .fetch(:write, true) install_dependencies([:require] || []) end |
Class Method Details
.to_html(file, style, template) ⇒ Object
Convert to HTML
This interface expect us to provide Relaton collection XML as XML/RXL, and necessary styels / templates then it will be used convert that collection to HTML.
33 34 35 |
# File 'lib/relaton/cli/base_convertor.rb', line 33 def self.to_html(file, style, template) new(file, style: style, template: template, extension: "html").to_html end |
Instance Method Details
#to_html ⇒ Object
18 19 20 21 |
# File 'lib/relaton/cli/base_convertor.rb', line 18 def to_html content = convert_to_html write_to_a_file(content) end |