在鲁比尼,如果你这样做

rbx-head > Object.instance_methods.grep(/^_.*/)
 => ["__extend__", "__show__", "__marshal__", "__instance_of__", "__instance_variable_get__", "__send__", "__id__", "__instance_variable_set__", "__respond_to_eh__", "__instance_variables__", "__class__", "__kind_of__", "__instance_variable_defined_eh__", "__nil__", "__metaclass__", "__fixnum__", "__method__"] 

包括 "__respond_to_eh__""__instance_variable_defined_eh__".

因此,这是因为Rubinius Folk想要包装不应该与之混为一谈的方法 __, ,您不允许使用 ? 在方法名称结束之前, 嗯?

有帮助吗?

解决方案

他们现在已经了 更改 使用 __instance_variable_defined_p____respond_to_p__ 根据他们的评论,在其他任何地方的谓词中。

嗯。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top