module OM::XML::Container::ClassMethods
Class Methods – These methods will be available on classes that include this Module
Public Instance Methods
By default, new OM
Document
instances will create an empty xml document, but if you override self.xml_template to return a different object (e.g. Nokogiri::XML::Document), that will be created instead. You can make this method create the documents however you want as long as it returns a Nokogiri::XML::Document. In the tutorials, we use Nokogiri::XML::Builder in this mehtod and call its .doc method at the end of xml_template
in order to return the Nokogiri::XML::Document object. Instead of using Nokogiri::XML::Builder, you could put your template into an actual xml file and have xml_template
use Nokogiri::XML::Document.parse to load it. That’s up to you. @return [Nokogiri::XML::Document]
# File lib/om/xml/container.rb, line 28 def xml_template Nokogiri::XML::Document.parse("") end