1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

ruby 1.9 returns method names as symbols

This commit is contained in:
Sergey Nartimov 2011-12-25 20:52:05 +03:00
parent 819ea5f9af
commit 33fb719667

View file

@ -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 method_names(*args)
methods(*args).map(&:to_s)
end
else
alias_method :instance_method_names, :instance_methods
alias_method :method_names, :methods
def instance_method_names(*args)
instance_methods(*args).map { |name| name.to_s }
end
end
def method_names(*args)
methods(*args).map { |name| name.to_s }
end
end