Module: Axn::Mountable::Helpers::NamespaceManager
- Extended by:
- NamespaceManager
- Included in:
- NamespaceManager
- Defined in:
- lib/axn/mountable/helpers/namespace_manager.rb
Overview
Handles namespace management for mounting
Instance Method Summary collapse
Instance Method Details
#get_or_create_namespace(target) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/axn/mountable/helpers/namespace_manager.rb', line 10 def get_or_create_namespace(target) # Check if :Axns is defined directly on this class (not inherited) if target.const_defined?(:Axns, false) axn_class = target.const_get(:Axns) return axn_class if axn_class.is_a?(Class) end # Create a fresh namespace class for this target create_namespace_class(target).tap do |namespace_class| target.const_set(:Axns, namespace_class) unless target.const_defined?(:Axns, false) end end |