Browse files

ruby 1.9 returns method names as symbols

  • Loading branch information...
1 parent 819ea5f commit 33fb719667d0e2799efc206b8fdb9359896ddb09 @lest lest committed Dec 25, 2011
Showing with 6 additions and 11 deletions.
  1. +6 −11 activesupport/lib/active_support/core_ext/module/method_names.rb
View
17 activesupport/lib/active_support/core_ext/module/method_names.rb
@@ -1,14 +1,9 @@
class Module
- if instance_methods[0].is_a?(Symbol)
- def instance_method_names(*args)
- instance_methods(*args).map(&:to_s)
- end
+ def instance_method_names(*args)
+ instance_methods(*args).map { |name| name.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
+ def method_names(*args)
+ methods(*args).map { |name| name.to_s }
end
-end
+end

0 comments on commit 33fb719

Please sign in to comment.