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:
parent
819ea5f9af
commit
33fb719667
1 changed files with 7 additions and 12 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue