# `RustyJson.Sigil`
[🔗](https://github.com/jeffhuen/rustyjson/blob/v0.3.9/lib/sigil.ex#L1)

JSON sigils for convenient JSON literals, compatible with Jason's `Sigil` module.

## Sigils

- `~j` — Decodes a JSON string. Supports interpolation. Without interpolation,
  decoding happens at compile time.
- `~J` — Decodes a JSON string at compile time. No interpolation.

## Modifiers

| Modifier | Option |
|----------|--------|
| `a` | `keys: :atoms` |
| `A` | `keys: :atoms!` |
| `r` | `strings: :reference` |
| `c` | `strings: :copy` |

Unknown modifiers raise `ArgumentError`.

## Examples

    import RustyJson.Sigil

    ~j({"name": "Alice", "age": 30})
    #=> %{"name" => "Alice", "age" => 30}

    ~j({"name": "Alice"})a
    #=> %{name: "Alice"}

    ~J({"x": 1, "y": 2})
    #=> %{"x" => 1, "y" => 2}

## Usage

Add `import RustyJson.Sigil` to use the sigils in your module.

# `sigil_J`
*macro* 

Handles the `~J` sigil for compile-time JSON decoding.

No interpolation is supported. Decoding always happens at compile time.

# `sigil_j`
*macro* 

Handles the `~j` sigil for JSON decoding.

When the string has no interpolation, decoding happens at compile time.
With interpolation, decoding happens at runtime.

---

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