# `TuningFork.Ring`
[🔗](https://github.com/jaman/tuning_fork/blob/v0.1.11/tuning_fork/lib/tuning_fork/ring.ex#L1)

A list read round and round, so any integer index is in it.

    iex> TuningFork.Ring.at([:c2, :e2, :g2], 4)
    :e2

# `at`

```elixir
@spec at([term()], integer()) :: term() | nil
```

The element at `index`. An index past the end wraps to the start and a negative one counts
back from the end. `nil` for an empty list.

    iex> TuningFork.Ring.at([1, 2, 3], 7)
    2
    iex> TuningFork.Ring.at([1, 2, 3], -1)
    3
    iex> TuningFork.Ring.at([], 0)
    nil

# `from`

```elixir
@spec from([term()], integer()) :: [term()]
```

The list turned so `index` is its head.

    iex> TuningFork.Ring.from([:a, :b, :c], 1)
    [:b, :c, :a]

# `take`

```elixir
@spec take([term()], integer(), non_neg_integer()) :: [term()]
```

`count` elements from `index` on, wrapping.

    iex> TuningFork.Ring.take([:a, :b, :c], 1, 4)
    [:b, :c, :a, :b]

---

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