# Class LittleGhost::Graph::State

Documentation version: Edge

Canonical HTML: https://littleghostai.org/docs/LittleGhost/Graph/State.html

Read-only routing data passed to conditions and input mappers.

`results` contains every completed node result. `incoming_results` contains
only the immediate predecessors supplying the current node. `previous` and
#previous_result are present for a single predecessor; `predecessors`
preserves declaration order for fan-in execution.

## Inheritance

`LittleGhost::Graph::State < Object`

## Attributes

<a id="attribute-i-context"></a>
### `context` (R)

A frozen copy of application context available to the condition or mapper.

<a id="attribute-i-current"></a>
### `current` (R)

The source node for a condition, or destination node for an input mapper.

<a id="attribute-i-error"></a>
### `error` (R)

A frozen copy of the routed exception available to an error-edge mapper.

<a id="attribute-i-history"></a>
### `history` (R)

A frozen copy of caller history available to the condition or mapper.

<a id="attribute-i-incoming_results"></a>
### `incoming_results` (R)

Frozen copies of immediate predecessor RunResults keyed by node name.

<a id="attribute-i-input"></a>
### `input` (R)

A copied Message containing the original request.

<a id="attribute-i-predecessors"></a>
### `predecessors` (R)

The immediate predecessor names in declaration order.

<a id="attribute-i-previous"></a>
### `previous` (R)

The predecessor name when exactly one result supplies the current node.

<a id="attribute-i-results"></a>
### `results` (R)

Frozen copies of completed RunResults keyed by node name.

<a id="attribute-i-step"></a>
### `step` (R)

The one-based execution count assigned to the current node.

## Instance methods

<a id="method-i-previous_result"></a>
### `#previous_result`

```ruby
#previous_result()
```

Returns the immediately preceding result when present.

<a id="method-i-result"></a>
### `#result`

```ruby
#result(node_name)
```

Returns a completed result by node name.
