From 8ad9cde866c8b9907c0cfd77a32c1720dcd3054d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Mon, 14 Oct 2024 14:52:12 +0200 Subject: [PATCH] Add documentation for `to_var` function #282 --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 287a9602..69007da8 100644 --- a/README.md +++ b/README.md @@ -267,6 +267,23 @@ put_vars( [Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+put_vars+{") +##### `to_var` + +Defines a single global variable that can be referenced with `$[]` and assinges the value of the ``. + +```perl +to_var("", "") +``` + +Options: + +- `"default"`: provide default value if source field does not exist. + + +[Example in Playground](https://metafacture.org/playground/?example=to_var) + +[Java Code](https://github.com/search?type=code&q=repo:metafacture/metafacture-fix+path:FixMethod.java+"+to_var+{") + #### Record-level functions ##### `add_field`