[1.9] Module.const_defined? and Module.const_get accept a second parameter to look up into the ancestors --------------------------------------------------------------------------------------------------------
Key: JRUBY-5304 URL: http://jira.codehaus.org/browse/JRUBY-5304 Project: JRuby Issue Type: Bug Components: Core Classes/Modules, Ruby 1.9 Affects Versions: JRuby 1.5.6 Reporter: David Calavera Assignee: David Calavera from ruby code {noformat} ------------------------------------------------------------------------------ mod.const_defined?(sym, inherit=true) -> true or false ------------------------------------------------------------------------------ Returns true if a constant with the given name is defined by mod, or its ancestors if inherit is not false. Math.const_defined? "PI" #=> true IO.const_defined? "SYNC" #=> true IO.const_defined? "SYNC", false #=> false ------------------------------------------------------------------------------ mod.const_get(sym, inherit=true) -> obj ------------------------------------------------------------------------------ Returns the value of the named constant in mod. Math.const_get(:PI) #=> 3.14159265358979 If the constant is not defined or is defined by the ancestors and inherit is false, NameError will be raised. {noformat} This cause some ActiveResource tests fail. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email