Google

def namespace prefix=nil if prefix.nil? prefix = prefix() end if prefix == '' else end ns = attributes[ prefix ] ns = parent.namespace(prefix) if ns.nil? and parent return ns end