提交 fc4f56ad 编写于 作者: X Xavier Noria

Merge pull request #4186 from lest/remove-1-8-code

ruby 1.9 returns method names as symbols
class Module class Module
if instance_methods[0].is_a?(Symbol) def instance_method_names(*args)
def instance_method_names(*args) instance_methods(*args).map { |name| name.to_s }
instance_methods(*args).map(&:to_s) end
end
def method_names(*args) def method_names(*args)
methods(*args).map(&:to_s) methods(*args).map { |name| name.to_s }
end
else
alias_method :instance_method_names, :instance_methods
alias_method :method_names, :methods
end end
end end
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册