module OM::XML::Document::ClassMethods
Class Methods – These methods will be available on classes that include this Module
Attributes
Public Instance Methods
Define a new node template with the OM::XML::TemplateRegistry
.
-
name
is a Symbol indicating the name of the new template. -
The
block
does the work of creating the new node, and will receive a Nokogiri::XML::Builder and any other args passed to one of the node instantiation methods.
# File lib/om/xml/document.rb, line 73 def define_template name, &block self.template_registry.define name, &block end
Update the OM::XML::Terminology
with additional terms
# File lib/om/xml/document.rb, line 58 def extend_terminology &block self.terminology_builder.extend_terminology(&block) rebuild_terminology! end
Returns any namespaces defined by the Class' Terminology
# File lib/om/xml/document.rb, line 78 def ox_namespaces self.terminology.namespaces end
# File lib/om/xml/document.rb, line 44 def rebuild_terminology! @terminology = @terminology_builder.build end
Sets the OM::XML::Terminology
for the Document
If there already is a termnology for this class, it will be replaced. @see extend_termniology If you want to add terms to an existing terminology Expects +&block+ that will be passed into OM::XML::Terminology::Builder.new
# File lib/om/xml/document.rb, line 52 def set_terminology &block @terminology_builder = OM::XML::Terminology::Builder.new(&block) rebuild_terminology! end
(Explicitly) inherit terminology from upstream classes
# File lib/om/xml/document.rb, line 64 def use_terminology klass self.terminology_builder = klass.terminology_builder.dup rebuild_terminology! end