class Stepmod::Utils::SmrlDescriptionConverter

Public Class Methods

convert(input, options = {}) click to toggle source
# File lib/stepmod/utils/smrl_description_converter.rb, line 31
def self.convert(input, options = {})
  root = case input
         when String
           Nokogiri::XML(input).root
         when Nokogiri::XML::Document
           input.root
         when Nokogiri::XML::Node
           input
         end

  root || (return "")

  ReverseAdoc.config.with(options) do
    result = ReverseAdoc::Converters.lookup(root.name).convert(root)
    Stepmod::Utils::Cleaner.new.tidy(result)
  end
end