When method_missing gets triggered it always gets a block, even when not passed.
class MissingError
def method_missing(method, *args, &block)
if block_given?
puts "block_given?"
end
if block
puts "block"
end
end
end
missing_error = MissingError.new
missing_error.hello
Expected result would be nothing, but both assume a block gets passed.
When method_missing gets triggered it always gets a block, even when not passed.
Expected result would be nothing, but both assume a block gets passed.