Flowdock
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 668
    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}"
      constantized = constantize(const)
      constantized.before_remove_const if constantized.respond_to?(:before_remove_const)
      parent.instance_eval { remove_const to_remove }

      return true
    end
Register or log in to add new notes.