UAParser.UA (ua_parser v1.9.1) View Source

User Agent struct and helper methods.

Link to this section Summary

Functions

Display the UA as a string.

Link to this section Types

Specs

t() :: %UAParser.UA{
  device: String.t(),
  family: String.t(),
  os: String.t(),
  version: String.t()
}

Link to this section Functions

Display the UA as a string.

Examples

iex> version = %UAParser.Version{major: "1", minor: "2", patch: "3", patch_minor: "4"}
iex> agent = %UAParser.UA{family: "Family", version: version}
iex> to_string(agent)
"Family 1.2.3.4"

iex> agent = %UAParser.UA{family: "Family"}
iex> to_string(agent)
"Family"

iex> agent = %UAParser.UA{}
iex> to_string(agent)
"Other"