remove_constant(const) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File activesupport/lib/active_support/dependencies.rb, line 635
    def remove_constant(const) #:nodoc:
      return false unless qualified_const_defined? const

      # Normalize ::Foo, Foo, Object::Foo, and ::Object::Foo to Object::Foo
      names = const.to_s.sub(/^::(Object)?/, 'Object::').split("::")
      to_remove = names.pop
      parent = Inflector.constantize(names * '::')

      log "removing constant #{const}"
      constantize(const).before_remove_const if constantize(const).respond_to?(:before_remove_const)
      parent.instance_eval { remove_const to_remove }

      return true
Register or log in to add new notes.