From: nobu@... Date: 2014-08-03T14:12:30+00:00 Subject: [ruby-core:64176] [ruby-trunk - Feature #10108] NameError#name and nested constants Issue #10108 has been updated by Nobuyoshi Nakada. Tracker changed from misc to Feature Description updated Do you want a method to return full qualified name, or an array of names? ---------------------------------------- Feature #10108: NameError#name and nested constants https://bugs.ruby-lang.org/issues/10108#change-48176 * Author: Robin Dupret * Status: Open * Priority: Normal * Assignee: * Category: core * Target version: ---------------------------------------- Hello, We wanted to bring a discussion around the behavior of NameError#name with nested constants. The result can be quite unexpected when we are dealing with them. For instance: ~~~ruby begin Math::PHI rescue NameError => e e.name # => :PHI end ~~~ Having Math::PHI seems more expected. Rubinius works the same way as MRI while JRuby will return a symbol with the full path (i.e. `:"Math::PHI"`). Is there any reason why you are returning only the last part of the missing "path" ? At the very least, there is a documentation problem since `NameError#name`'s documentation states: ~~~ name_error.name -> string or nil ~~~ but it always return a symbol. Have a nice day ! -- https://bugs.ruby-lang.org/