OpenUI.JSON.Object (OpenUI v0.1.1)

Copy Markdown View Source

A JSON object that keeps the order of its keys.

A LibrarySpec gives meaning to key order: the keys of a component's properties are its positional arguments. Elixir maps do not keep order, so OpenUI.JSON.decode/1 returns objects as this struct.

Summary

Functions

Returns the value of key, or default when the object has no such key.

Returns the keys in their order.

Types

t()

@type t() :: %OpenUI.JSON.Object{pairs: [{String.t(), term()}]}

Functions

get(object, key, default \\ nil)

@spec get(t(), String.t(), term()) :: term()

Returns the value of key, or default when the object has no such key.

keys(object)

@spec keys(t()) :: [String.t()]

Returns the keys in their order.