Implicit argument passing of super from method defined by define_method() is not supported

情到浓时终转凉″ 提交于 2019-12-04 00:41:36
Marc-André Lafortune

The super above passed all parameters (see this recent question).

As the error message states, you must here "specify all arguments explicitly". Replace super with super(label, *args).

I encountered with this problem in a define_method without arguments

define_method :"#{info_type}_info" do

  info = super
  .......

end

And still found this problem. I had to explicit put the parenthesis:

define_method :"#{info_type}_info" do

  info = super()
  .......

end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!