OpenFlags (OpenFlags v0.1.0)

View Source

A lightweight interface to access local SVG flags via file path.

Summary

Functions

Returns the full path to a given flag if it exists.

Reads and returns the raw SVG contents of a flag.

Functions

get_path(country, region)

Returns the full path to a given flag if it exists.

Example

iex> OpenFlags.get_path("usa", "arizona")
{:ok, "/path/to/open_flags/priv/static/flags/usa/arizona.svg"}

get_svg(country, region)

Reads and returns the raw SVG contents of a flag.

Example

iex> OpenFlags.get_svg("canada", "ontario")
{:ok, "<svg..."}