method

local_constant_names

Importance_1
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: Module

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v4.0.2) is shown here.

local_constant_names() public

DEPRECATED: Use local_constants instead.

Returns the names of the constants defined locally as strings.

module M
  X = 1
end
M.local_constant_names # => ["X"]

This method is useful for forward compatibility, since Ruby 1.8 returns constant names as strings, whereas 1.9 returns them as symbols.

Show source
Register or log in to add new notes.