->(*args2, **kw2, &block2) do placeholder_idx = 0 new_args = args.each_with_object([]) do |a, arr| if a.is_a?(MethodPlus::Placeholder) if (args2.size - 1) >= placeholder_idx arr << args2[placeholder_idx].tap { placeholder_idx += 1 }; end else arr << a; end; end # ... new_block = block2 || block call(*new_args, **new_kw, &new_block) end end