View Source Hugs.Sample.WithEnums (hugs v0.2.2)

Link to this section Summary

Functions

Create a new Hugs.Sample.WithEnums struct from a map or a struct.

Create a new Hugs.Sample.WithEnums struct from a list of properties.

Link to this section Types

@type as_map() :: %{
  atoms_only: :open | :closed,
  bin_only: binary(),
  mixed: :open | binary() | 1 | 2
}
@type kv() ::
  {:atoms_only, :open | :closed}
  | {:bin_only, binary()}
  | {:mixed, :open | binary() | 1 | 2}
@type kvs() :: [kv()]
@type t() :: %Hugs.Sample.WithEnums{
  atoms_only: :open | :closed,
  bin_only: binary(),
  mixed: :open | binary() | 1 | 2
}

Link to this section Functions

@spec denormalize!(term()) :: t()
Link to this function

denormalize!(data, opts)

View Source
@spec denormalize!(term(), Hugs.Norde.denormalize_opts()) :: t()
@spec denormalize(term()) :: {:ok, t()} | {:error, term()}
@spec denormalize(term(), Hugs.Norde.denormalize_opts()) ::
  {:ok, t()} | {:error, term()}
@spec new(kvs() | as_map() | t()) :: t()

Create a new Hugs.Sample.WithEnums struct from a map or a struct.

@spec of(kvs()) :: t()

Create a new Hugs.Sample.WithEnums struct from a list of properties.