% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/hotpatch.R
\name{inject_patch}
\alias{inject_patch}
\title{Inject a runtime patch into a locked package namespace}
\usage{
inject_patch(pkg, patch_list, lock = TRUE)
}
\arguments{
\item{pkg}{A package name as a string.}

\item{patch_list}{A named list of functions to overwrite in the package namespace.}

\item{lock}{Whether to re-lock bindings after patching.}
}
\value{
Invisibly TRUE on success.
}
\description{
Inject a runtime patch into a locked package namespace
}
\examples{
# Show baseline behavior with broken function
baseline <- dummy_parent_func("test")
print(baseline)

# Inject a patched version of the child function
inject_patch(
  pkg = "hotpatchR",
  patch_list = list(dummy_child_func = function(x) {
    paste("I am the FIXED child! Input:", x)
  })
)

# Call the parent function again - it now uses the patched child
patched_result <- dummy_parent_func("test")
print(patched_result)
}
