Converts a subject into the value that Gut sends to an adapter.
The result is the text sent to the adapter. Gut sends strings unchanged and encodes other values as JSON.
Derive this protocol to choose which struct fields Gut can send:
defmodule Ticket do
@derive {Gut.Subject, only: [:subject, :body]}
defstruct [:subject, :body, :internal_notes]
endDerivation accepts :only or :except. Prefer :only so new fields are not
exposed by accident. A derivation without options includes every struct field.
Implement the protocol directly when a subject needs a custom representation.
Summary
Functions
Returns the text sent as the subject.
Types
@type t() :: term()
All the types that implement this protocol.