class Lutaml::Xml::Schema::Builder::Nokogiri

Wraps Nokogiri::XML::Builder to provide schema building capabilities
Nokogiri adapter for XSD schema generation

def initialize(options = {}, &block)

def initialize(options = {}, &block)
  encoding = options[:encoding] || "UTF-8"
  @builder = if block
               ::Nokogiri::XML::Builder.new(encoding: encoding,
             else
               ::Nokogiri::XML::Builder.new(encoding: encoding)
             end
end

def to_xml(options = {})

Returns:
  • (String) - XSD XML string

Options Hash: (**options)
  • :indent (Integer) -- Number of spaces for indentation (default: 2)
  • :pretty (Boolean) -- Pretty print with indentation

Parameters:
  • options (Hash) -- formatting options
def to_xml(options = {})
  if options[:pretty]
    indent = options[:indent] || 2
    @builder.to_xml(indent: indent)
  else
    @builder.to_xml
  end
end