Class: Relaton::Cli::XMLConvertor
- Inherits:
-
BaseConvertor
- Object
- BaseConvertor
- Relaton::Cli::XMLConvertor
- Defined in:
- lib/relaton/cli/xml_convertor.rb
Class Method Summary collapse
-
.to_yaml(file, options = {}) ⇒ Object
Convert to YAML.
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_yaml(file, options = {}) ⇒ Object
Convert to YAML
This interface allow us to convert any XML file to YAML. It only require us to provide a valid XML file and it can do converstion using default attributes, but it also allow us to provide custom options to customize this converstion process.
22 23 24 |
# File 'lib/relaton/cli/xml_convertor.rb', line 22 def self.to_yaml(file, = {}) new(file, ).to_yaml end |
Instance Method Details
#to_yaml ⇒ Object
7 8 9 |
# File 'lib/relaton/cli/xml_convertor.rb', line 7 def to_yaml convert_and_write(file_content, :to_yaml) end |