Class: Relaton::Cli::YAMLConvertor
- Inherits:
-
BaseConvertor
- Object
- BaseConvertor
- Relaton::Cli::YAMLConvertor
- Defined in:
- lib/relaton/cli/yaml_convertor.rb
Class Method Summary collapse
-
.to_xml(file, options = {}) ⇒ Object
Convert to XML.
Instance Method Summary collapse
Methods inherited from BaseConvertor
#initialize, #to_html, to_html
Constructor Details
This class inherits a constructor from Relaton::Cli::BaseConvertor
Class Method Details
.to_xml(file, options = {}) ⇒ Object
Convert to XML
This interface allow us to convert any YAML file to XML. It only require us to provide a valid YAML file and it can do converstion using default attributes, but it also allow us to provide custom options to customize this converstion process.
27 28 29 |
# File 'lib/relaton/cli/yaml_convertor.rb', line 27 def self.to_xml(file, = {}) new(file, ).to_xml end |
Instance Method Details
#to_xml ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/relaton/cli/yaml_convertor.rb', line 8 def to_xml if writable convert_and_write(file_content, :to_xml) else convert_content(file_content).to_xml(date_format: :full, bibdata: true) end end |