aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/module/introspection.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module/introspection.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/module/introspection.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/introspection.rb b/activesupport/lib/active_support/core_ext/module/introspection.rb
index 36481927aa..7e4d8e44fc 100644
--- a/activesupport/lib/active_support/core_ext/module/introspection.rb
+++ b/activesupport/lib/active_support/core_ext/module/introspection.rb
@@ -32,4 +32,10 @@ class Module
! inherited.key?(const) || inherited[const].object_id != const_get(const).object_id
end
end
+
+ # Returns the names of the constants defined locally rather than the
+ # constants themselves. See <tt>local_constants</tt>.
+ def local_constant_names
+ local_constants.map(&:to_s)
+ end
end