gravatar v0.1.0 Gravatar

Simple module to generate Gravatar URLs

Summary

Functions

Generates a gravatar url for a given email

Sets https to the generated URL

Sets the size parameter in the query string

Returns a URI representation for the Gravatar struct

Functions

new(email)

Generates a gravatar url for a given email.

Example

> Gravatar.new("test@example.com")
  |> to_string

# "http://www.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0"
secure(gravatar)

Sets https to the generated URL.

Example

> Gravatar.new("test@example.com")
  |> Gravatar.secure
  |> to_string

# "https://www.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0"
size(gravatar, s)

Sets the size parameter in the query string.

Example

> Gravatar.new("test@example.com")
  |> Gravatar.size(500)
  |> to_string

# "http://www.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0?s=500"
to_uri(gravatar)

Returns a URI representation for the Gravatar struct.

Example

> Gravatar.new("test.example.com") |> Gravatar.to_uri

# %URI{authority: nil, fragment: nil, host: "www.gravatar.com",
   path: "/avatar/e016d237b9139e919a77983b7ed1e17d", port: nil, query: nil,
   scheme: "http", userinfo: nil}