def load_nested_constant(constant)
      if constant.start_with?("::")
        constant = constant.sub(/^::/, "")
      else
        # ["A", "B", "C"] -> ["A::B::C", "A::B", "A"]
        namespaces = module_nesting.size.downto(1).map do |n|
          module_nesting.take(n).join("::")
        end

        namespaces.each do |ns|
          load_constant("#{ns}::#{constant}")
        end
      end
      load_constant(constant)
    end
def load_nested_constant(constant)
      if constant.start_with?("::")
        constant = constant.sub(/^::/, "")
      else
        # ["A", "B", "C"] -> ["A::B::C", "A::B", "A"]
        namespaces = module_nesting.size.downto(1).map do |n|
          module_nesting.take(n).join("::")
        end

        namespaces.each do |ns|
          load_constant("#{ns}::#{constant}")
        end
      end
      load_constant(constant)
    end
Tries to load the definitions for the given constant.
 Takes into account what modules we are in to resolve the constant name.

 @param [String] constant name, possibly unqualified