Faker.Avatar (Faker v0.16.0) View Source

Functions for generate random urls for avatars.

Link to this section Summary

Functions

Return avatar url with random set and background.

Return avatar url for given slug.

Return avatar url with random set and background, with size width x height pixels.

Return avatar url for given slug, with size width x height pixels.

Link to this section Functions

Specs

image_url() :: String.t()

Return avatar url with random set and background.

Examples

iex> Faker.Avatar.image_url()
"http://robohash.org/set_set1/bgset_bg2/kQqaIfGqxsjFoNIT"
iex> Faker.Avatar.image_url()
"http://robohash.org/set_set2/bgset_bg2/6"
iex> Faker.Avatar.image_url()
"http://robohash.org/set_set2/bgset_bg2/J"
iex> Faker.Avatar.image_url()
"http://robohash.org/set_set3/bgset_bg1/JNth88PrhGDhwp4LNQMt"

Specs

image_url(binary()) :: String.t()

Return avatar url for given slug.

Examples

iex> Faker.Avatar.image_url('faker')
"http://robohash.org/faker"
iex> Faker.Avatar.image_url('elixir')
"http://robohash.org/elixir"
iex> Faker.Avatar.image_url('plug')
"http://robohash.org/plug"
iex> Faker.Avatar.image_url('ecto')
"http://robohash.org/ecto"
Link to this function

image_url(width, height)

View Source

Specs

image_url(integer(), integer()) :: String.t()

Return avatar url with random set and background, with size width x height pixels.

Examples

iex> Faker.Avatar.image_url(200, 200)
"http://robohash.org/set_set2/bgset_bg2/ppkQqaIfGqx?size=200x200"
iex> Faker.Avatar.image_url(800, 600)
"http://robohash.org/set_set2/bgset_bg2/oNITNnu6?size=800x600"
iex> Faker.Avatar.image_url(32, 32)
"http://robohash.org/set_set3/bgset_bg1/J?size=32x32"
iex> Faker.Avatar.image_url(128, 128)
"http://robohash.org/set_set1/bgset_bg2/JNth88PrhGDhwp4LNQMt?size=128x128"
Link to this function

image_url(slug, width, height)

View Source

Specs

image_url(binary(), integer(), integer()) :: String.t()

Return avatar url for given slug, with size width x height pixels.

Examples

iex> Faker.Avatar.image_url('phoenix', 100, 100)
"http://robohash.org/phoenix?size=100x100"
iex> Faker.Avatar.image_url('haskell', 200, 200)
"http://robohash.org/haskell?size=200x200"
iex> Faker.Avatar.image_url('ocaml', 300, 300)
"http://robohash.org/ocaml?size=300x300"
iex> Faker.Avatar.image_url('idris', 400, 400)
"http://robohash.org/idris?size=400x400"