View Source Reactor.Argument (reactor v0.3.0)

A step argument.

Link to this section Summary

Functions

Build an argument which refers to a reactor input with an optional transformation applied.

Build an argument which refers to the result of another step with an optional transformation applied.

Build an argument which refers to a statically defined value.

Validate that the argument has a transform.

Validate that the argument is an Argument struct.

Validate that the argument refers to a reactor input.

Validate that the argument refers to a step result.

Validate that the argument contains a static value.

Link to this section Types

@type t() :: %Reactor.Argument{
  name: atom(),
  source:
    Reactor.Template.Input.t()
    | Reactor.Template.Result.t()
    | Reactor.Template.Value.t(),
  transform: nil | (any() -> any()) | {module(), keyword()} | mfa()
}

Link to this section Functions

Link to this function

from_input(name, input_name, transform \\ nil)

View Source
@spec from_input(atom(), atom(), nil | (any() -> any())) :: t()

Build an argument which refers to a reactor input with an optional transformation applied.

example

Example

iex> Argument.from_input(:argument_name, :input_name, &String.to_integer/1)
Link to this function

from_result(name, result_name, transform \\ nil)

View Source
@spec from_result(atom(), any(), nil | (any() -> any())) :: t()

Build an argument which refers to the result of another step with an optional transformation applied.

example

Example

iex> Argument.from_result(:argument_name, :step_name, &Atom.to_string/1)
Link to this function

from_value(name, value, transform \\ nil)

View Source
@spec from_value(atom(), any(), nil | (any() -> any())) :: t()

Build an argument which refers to a statically defined value.

example

Example

iex> Argument.from_value(:argument_name, 10)
Link to this macro

has_transform(argument)

View Source (macro)

Validate that the argument has a transform.

Link to this macro

is_argument(argument)

View Source (macro)

Validate that the argument is an Argument struct.

Link to this macro

is_from_input(argument)

View Source (macro)

Validate that the argument refers to a reactor input.

Link to this macro

is_from_result(argument)

View Source (macro)

Validate that the argument refers to a step result.

Link to this macro

is_from_value(argument)

View Source (macro)

Validate that the argument contains a static value.