View Source Hugs.Sample (hugs v0.2.1)

Link to this section Summary

Functions

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

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

Link to this section Types

@type as_map() :: %{
  ser_map: %{optional(binary()) => integer()},
  ser_one: integer(),
  ser_two: integer(),
  sub: Hugs.Sample.Sub.t(),
  sub_map: %{optional(binary()) => Hugs.Sample.Sub.t()}
}
@type kv() ::
  {:ser_map, %{optional(binary()) => integer()}}
  | {:ser_one, integer()}
  | {:ser_two, integer()}
  | {:sub, Hugs.Sample.Sub.t()}
  | {:sub_map, %{optional(binary()) => Hugs.Sample.Sub.t()}}
@type kvs() :: [kv()]
@type t() :: %Hugs.Sample{
  ser_map: %{optional(binary()) => integer()},
  ser_one: integer(),
  ser_two: integer(),
  sub: Hugs.Sample.Sub.t(),
  sub_map: %{optional(binary()) => Hugs.Sample.Sub.t()}
}

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 struct from a map or a struct.

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

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