aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/module/method_names.rb
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-03-26 15:10:24 -0700
committerwycats <wycats@gmail.com>2010-03-26 15:10:24 -0700
commit197904341f2b2f21d69c653cede3aec124e86720 (patch)
tree83f1234e238016126860a929594db22e1862d783 /activesupport/lib/active_support/core_ext/module/method_names.rb
parent76d2c455c0607b4cd5f238cadef8f933a18567fb (diff)
parentb3a0aed028835ce4551c4a76742744a40a71b0be (diff)
downloadrails-197904341f2b2f21d69c653cede3aec124e86720.tar.gz
rails-197904341f2b2f21d69c653cede3aec124e86720.tar.bz2
rails-197904341f2b2f21d69c653cede3aec124e86720.zip
Merge branch 'master' into docrails
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module/method_names.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/module/method_names.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/method_names.rb b/activesupport/lib/active_support/core_ext/module/method_names.rb
new file mode 100644
index 0000000000..2eb40a83ab
--- /dev/null
+++ b/activesupport/lib/active_support/core_ext/module/method_names.rb
@@ -0,0 +1,14 @@
+class Module
+ if instance_methods[0].is_a?(Symbol)
+ def instance_method_names(*args)
+ instance_methods(*args).map(&:to_s)
+ end
+
+ def method_names(*args)
+ methods(*args).map(&:to_s)
+ end
+ else
+ alias_method :instance_method_names, :instance_methods
+ alias_method :method_names, :methods
+ end
+end \ No newline at end of file