Yubin.Prefecture (yubin v0.1.0)

Copy Markdown View Source

One of the 47 prefectures, identified by its JIS X 0401 code.

slug is a stable romaji atom, suitable for an Ecto.Enum.

Summary

Functions

Returns the 47 prefectures in JIS order, from 01 Hokkaido to 47 Okinawa.

Returns the prefecture with the 2-digit JIS code, or nil.

Returns the prefecture with the slug, or nil.

Types

slug()

@type slug() ::
  :hokkaido
  | :aomori
  | :iwate
  | :miyagi
  | :akita
  | :yamagata
  | :fukushima
  | :ibaraki
  | :tochigi
  | :gunma
  | :saitama
  | :chiba
  | :tokyo
  | :kanagawa
  | :niigata
  | :toyama
  | :ishikawa
  | :fukui
  | :yamanashi
  | :nagano
  | :gifu
  | :shizuoka
  | :aichi
  | :mie
  | :shiga
  | :kyoto
  | :osaka
  | :hyogo
  | :nara
  | :wakayama
  | :tottori
  | :shimane
  | :okayama
  | :hiroshima
  | :yamaguchi
  | :tokushima
  | :kagawa
  | :ehime
  | :kochi
  | :fukuoka
  | :saga
  | :nagasaki
  | :kumamoto
  | :oita
  | :miyazaki
  | :kagoshima
  | :okinawa

t()

@type t() :: %Yubin.Prefecture{
  code: String.t(),
  kana: String.t(),
  name: String.t(),
  slug: slug()
}

Functions

all()

@spec all() :: [t()]

Returns the 47 prefectures in JIS order, from 01 Hokkaido to 47 Okinawa.

from_code(arg1)

@spec from_code(String.t()) :: t() | nil

Returns the prefecture with the 2-digit JIS code, or nil.

from_slug(arg1)

@spec from_slug(atom()) :: t() | nil

Returns the prefecture with the slug, or nil.