def resolve_constant(constant)
      current = Object
      final   = nil

      constant.split('::').each do |segment|
        if current.const_defined?(segment)
          current = final = current.const_get(segment)
        else
          raise(
            ArgumentError,
            "Constant #{segment} does not exist in #{constant}"
          )
        end
      end

      return final
    end
def resolve_constant(constant)
      current = Object
      final   = nil

      constant.split('::').each do |segment|
        if current.const_defined?(segment)
          current = final = current.const_get(segment)
        else
          raise(
            ArgumentError,
            "Constant #{segment} does not exist in #{constant}"
          )
        end
      end

      return final
    end
Converts a String based constant path into an actual constant.

 @param [String] constant
 @return [Class]
 @raise [ArgumentError] Raised when one of the segments doesn't exist.