class ActiveAdmin::Application

def namespace(name)

@returns [Namespace] the new or existing namespace

Yields the namespace if a block is given

Creates a namespace for the given name
def namespace(name)
  name ||= :root
  if namespaces[name]
    namespace = namespaces[name]
  else
    namespace = namespaces[name] = Namespace.new(self, name)
    ActiveAdmin::Event.dispatch ActiveAdmin::Namespace::RegisterEvent, namespace
  end
  yield(namespace) if block_given?
  namespace
end