A named parameter type with a regexp and transformer.
Summary
Functions
Build a ParameterType struct.
Apply the parameter type's transformer to a list of captures.
Types
Functions
Build a ParameterType struct.
Examples
iex> pt = Cucumberex.ParameterType.new("int", ~r/\d+/, fn [s] -> String.to_integer(s) end)
iex> pt.name
"int"
iex> pt.use_for_snippets
true
iex> pt = Cucumberex.ParameterType.new("x", ~r/x/, fn _ -> nil end, use_for_snippets: false)
iex> pt.use_for_snippets
false
Apply the parameter type's transformer to a list of captures.
Examples
iex> pt = Cucumberex.ParameterType.new("int", ~r/\d+/, fn [s] -> String.to_integer(s) end)
iex> Cucumberex.ParameterType.transform(pt, ["42"])
42