# `Cucumber.StepRegistry.Definition`
[🔗](https://github.com/huddlz-hq/cucumber/blob/main/lib/cucumber/step_registry.ex#L34)

One step definition in a `Cucumber.StepRegistry`.

  * `:position` - the definition's index in file-and-line order
  * `:kind` - `:expression` (cucumber expression) or `:regex`
  * `:source` - the expression text, or the regex source
  * `:module` / `:function` - the step function, called with the context
  * `:file` / `:line` - where the definition is written

The `:matcher` field is internal.

# `t`

```elixir
@type t() :: %Cucumber.StepRegistry.Definition{
  file: String.t(),
  function: atom(),
  kind: :expression | :regex,
  line: pos_integer(),
  matcher: term(),
  module: module(),
  position: non_neg_integer(),
  source: String.t()
}
```

# `display_pattern`

```elixir
@spec display_pattern(t()) :: String.t()
```

Renders the pattern as written: an expression verbatim, a regex as a
sigil with its flags.

## Examples

    Cucumber.StepRegistry.Definition.display_pattern(definition)
    # => "I have {int} cukes" or "~r/^I have (\d+) cukes$/i"

---

*Consult [api-reference.md](api-reference.md) for complete listing*
