Ghibli.People (ghibli_api v0.1.0)

Handles fetching and parsing people endpoint from the Ghibli API. The data looks like this:

{
  "id": "ba924631-068e-4436-b6de-f3283fa848f0",
  "name": "Cat King",
  "gender": "Male",
  "eye_color": "Emerald",
  "hair_color": "Grey",
  "films": [
    "https://ghibliapi.vercel.app/films/90b72513-afd4-4570-84de-a56c312fdf81"
  ],
  "species": "https://ghibliapi.vercel.app/species/603428ba-8a86-4b0b-a9f1-65df6abef3d3",
  "url": "https://ghibliapi.vercel.app/people/3042818d-a8bb-4cba-8180-c19249822d57"
}

Summary

Types

t()

@type t() :: %Ghibli.People{
  age: String.t(),
  eye_color: String.t(),
  films: [String.t()],
  gender: String.t(),
  hair_color: String.t(),
  id: String.t(),
  name: String.t(),
  species: String.t(),
  url: String.t()
}

Functions

all()

@spec all() :: {:ok, [t()]} | {:error, String.t()}

get_by(id)

@spec get_by(id :: String.t()) :: {:ok, t()} | {:error, String.t()}