View Source YubinBango (YubinBango v0.1.3)
YubinBango is a library for lookup address with Japan postal code.
Summary
Functions
Returns a specification to start this module under a supervisor.
Lookup the zipcode and return the result.
Start the yubin bango server.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec lookup(String.t()) :: {:ok, map()} | {:error, :wrong_format, String.t()} | {:error, :not_found}
Lookup the zipcode and return the result.
Examples
iex> YubinBango.lookup("105-0004") {:ok, %YubinBango.Address{city: "港区", city_kana: "ミナトク", district: "新橋", district_kana: "シンバシ", prefecture: "東京都", prefecture_kana: "トウキョウト", zipcode: "1050004"}}
iex> YubinBango.lookup("1050004") {:ok, %YubinBango.Address{city: "港区", city_kana: "ミナトク", district: "新橋", district_kana: "シンバシ", prefecture: "東京都", prefecture_kana: "トウキョウト", zipcode: "1050004"}}
iex> YubinBango.lookup("1234567")
iex> YubinBango.lookup("12345678")
@spec start_link([]) :: {:ok, pid()}
Start the yubin bango server.