aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/module/method_names.rb
diff options
context:
space:
mode:
authorwycats <wycats@gmail.com>2010-03-17 00:15:55 -0700
committerwycats <wycats@gmail.com>2010-03-17 00:20:09 -0700
commita5587efc1903fd27d4b179753aa6e139445ad18c (patch)
tree7642d070d3f876e4c11b7aea3cded9ec2ffd2d79 /activesupport/lib/active_support/core_ext/module/method_names.rb
parentcd9ffd11e13ef6e62eba2cbd5c3760ff04132820 (diff)
downloadrails-a5587efc1903fd27d4b179753aa6e139445ad18c.tar.gz
rails-a5587efc1903fd27d4b179753aa6e139445ad18c.tar.bz2
rails-a5587efc1903fd27d4b179753aa6e139445ad18c.zip
Remove some 1.9 warnings (resulting in some fixed bugs). Remaining AM warnings are in dependencies.
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