module XMLable::Mixins::NamespaceDefinitionsStorage
NamespaceDefinitionsStorage
module contains the logic to manage with XML
namespaces definitions
Public Class Methods
included(base)
click to toggle source
# File lib/xmlable/mixins/namespace_definitions_storage.rb, line 8 def self.included(base) base.send(:extend, ClassMethods) end
new(*)
click to toggle source
@see XMLable::Mixins::Object#initialize
Calls superclass method
# File lib/xmlable/mixins/namespace_definitions_storage.rb, line 15 def initialize(*) super __define_namespaces(__namespace_definitions) end
Public Instance Methods
__define_namespaces(handlers)
click to toggle source
Define XML namespaces
@param [Array<XMLable::Handlers::Namespace>] handlers
@api private
# File lib/xmlable/mixins/namespace_definitions_storage.rb, line 27 def __define_namespaces(handlers) handlers.each do |h| next if __node.namespace_scopes.find { |ns| ns.prefix == h.prefix } __node.add_namespace_definition(h.prefix ? h.prefix.to_s : nil, h.href) end end
__namespace_definitions()
click to toggle source
Get namespace definition handlers
@api private
@return [XMLable::Handlers::Storage]
# File lib/xmlable/mixins/namespace_definitions_storage.rb, line 52 def __namespace_definitions @__namespace_definitions ||= self.class.__namespace_definitions.clone end
__set_namespace_definition(ns)
click to toggle source
Set XML namespace
@param [Nokogiri::XML::Namespace] ns
@api private
# File lib/xmlable/mixins/namespace_definitions_storage.rb, line 41 def __set_namespace_definition(ns) __namespace_definitions << ns end