JSCalendar.Link (JSCalendar v0.1.0)

Copy Markdown View Source

An external resource associated with an object (RFC 8984 §1.4.11).

Summary

Functions

Read this object from a decoded JSON map.

The @type value RFC 8984 gives this object.

Write this object back to a JSON-ready map.

Types

t()

@type t() :: %JSCalendar.Link{
  cid: String.t() | nil,
  content_type: String.t() | nil,
  display: String.t() | nil,
  extra: map(),
  href: String.t() | nil,
  rel: String.t() | nil,
  size: non_neg_integer() | nil,
  title: String.t() | nil
}

Functions

from_map(map)

@spec from_map(map()) :: {:ok, struct()} | {:error, term()}

Read this object from a decoded JSON map.

Arguments

Returns

  • {:ok, object}; or

  • {:error, reason} when a property does not match its declared type.

jscalendar_type()

@spec jscalendar_type() :: String.t()

The @type value RFC 8984 gives this object.

Returns

  • the type name as a string.

to_map(object)

@spec to_map(struct()) :: map()

Write this object back to a JSON-ready map.

Arguments

  • object is a t/0.

Returns