Navigation Structure

Table of contents

  1. _string
  2. _int
  3. _float
  4. _json
  5. _fromJson
  6. _yaml
  7. _fromYaml

Funcml knows how to cast data types using functions.

_string

_string takes an integer, a float, a dictionary (Hash) or an Array and stringifies it.

Usage

key:
  _string: 1

will be rendered as:

key: "1"

_int

_int takes a string or a float and returns a unsigned integer.

Usage

key:
  _int: "1"

will be rendered as:

key: 1

_float

_float takes a string or an integer and returns a float.

Usage

key:
  _float: "1"

will be rendered as:

key: 1.0

_json

_json returns its structure in JSON.

Usage

key:
  _json:
    subkey: value

will be rendered as:

key: '{"subkey":"value"}'

_fromJson

_fromJson returns a data-structure from a JSON string.

Usage

key:
  _fromJson: |
    '{"subkey": "value"}'

will be rendered as:

key:
  subkey: value

_yaml

_yaml returns its structure in YAML string.

Usage

key:
  _yaml:
    subkey: value

will be rendered as:

key: '---\nsubkey: value'

_fromYaml

_fromYaml returns a data-structure from a YAML string.

Usage

key:
  _fromYaml: |
    ---
    subkey: value

will be rendered as:

key:
  subkey: value