Ghibli.Location (ghibli_api v0.1.0)

Houses the logic for fetching locations from the Studio Ghibli API. The shape of the data looks as follows:

{
  "id": "11014596-71b0-4b3e-b8c0-1c4b15f28b9a",
  "name": "Irontown",
  "climate": "Continental",
  "terrain": "Mountain",
  "surface_water": "40",
  "residents": [
    "https://ghibliapi.vercel.app/people/ba924631-068e-4436-b6de-f3283fa848f0"
  ],
  "films": [
    "https://ghibliapi.vercel.app/films/0440483e-ca0e-4120-8c50-4c8cd9b965d6"
  ],
  "url": "https://ghibliapi.vercel.app/locations/11014596-71b0-4b3e-b8c0-1c4b15f28b9a"
}

Summary

Types

t()

@type t() :: %Ghibli.Location{
  climate: String.t(),
  films: [String.t()],
  id: String.t(),
  name: String.t(),
  residents: [String.t()],
  surface_water: String.t(),
  terrain: 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()}