According to rubyspec, this is the correct behavior, even if you pass explicit super arguments (i.e. super('foo')
)
If you do not want to pass this block, you can simply pass a block that does nothing, although this is not quite the same (for example, if the method changes its behavior based on block_given?
)
It seems that
super(&nil)
is a way to pass no block at all super, although I could not find it in the ruby specification.
source share