lib/dav4rack/controller.rb
# Namespace being used within XML document
# TODO: Make this better
Namespace being used within XML document
TODO: Make this better
Namespace being used within XML document TODO : Make this better
def ns(wanted_uri="DAV:")
      _ns = ''
      if(request_document && request_document.root && request_document.root.namespace_definitions.size > 0)
        _ns = request_document.root.namespace_definitions.collect{|__ns| __ns if __ns.href == wanted_uri}.compact
        if _ns.empty?
          _ns = request_document.root.namespace_definitions.first.prefix.to_s if _ns.empty?
        else
          _ns = _ns.first
          _ns = _ns.prefix.nil? ? 'xmlns' : _ns.prefix.to_s
        end
        _ns += ':' unless _ns.empty?
      end
      _ns
    end
def ns ( wanted_uri = "DAV:" ) _ns = '' if ( request_document && request_document . root && request_document . root . namespace_definitions . size > 0 ) _ns = request_document . root . namespace_definitions . collect { | __ns | __ns if __ns . href == wanted_uri } . compact if _ns . empty? _ns = request_document . root . namespace_definitions . first . prefix . to_s if _ns . empty? else _ns = _ns . first _ns = _ns . prefix . nil? ? 'xmlns' : _ns . prefix . to_s end _ns += ':' unless _ns . empty? end _ns end
Namespace being used within XML document
TODO: Make this better
Namespace being used within XML document TODO : Make this better
wanted_uri
<not_specific>