Figler.Scene.Graph.Oracle.Node (figler v0.1.0-beta.1)

Copy Markdown View Source

JSON shape used for oracle scene-node comparisons.

Oracle nodes intentionally contain a small, stable subset of scene fields so fixture comparisons stay focused on resolver-visible behavior.

Summary

Functions

Decodes a JSON string into this struct.

Decodes a JSON string into this struct, raising on failure.

Dumps this struct into JSON-shaped data, respecting JSON field names.

Builds this struct from a decoded JSON map.

Builds this struct from a decoded JSON map, raising on failure.

Returns a JSON Schema-compatible schema map.

Returns a JSON Schema-compatible schema map.

Converts this struct into a JSON-shaped map.

Types

number_or_nil()

@type number_or_nil() :: number() | nil

t()

@type t() :: %Figler.Scene.Graph.Oracle.Node{
  characters: String.t() | nil,
  child_count: non_neg_integer(),
  children: [map()],
  guid: String.t() | nil,
  height: number_or_nil(),
  locked: boolean() | nil,
  name: String.t() | nil,
  parent: String.t() | nil,
  type: String.t() | nil,
  visible: boolean() | nil,
  width: number_or_nil(),
  x: number_or_nil(),
  y: number_or_nil()
}

Functions

children_from_maps(children)

decode(json)

Decodes a JSON string into this struct.

decode!(json)

Decodes a JSON string into this struct, raising on failure.

dump(struct)

Dumps this struct into JSON-shaped data, respecting JSON field names.

from_map(map)

Builds this struct from a decoded JSON map.

from_map!(map)

Builds this struct from a decoded JSON map, raising on failure.

json_schema()

Returns a JSON Schema-compatible schema map.

schema()

Returns a JSON Schema-compatible schema map.

to_map(struct)

Converts this struct into a JSON-shaped map.