View Source Weather.Opts (Weather v0.1.3)

The Weather.Opts struct.

Fields:

  • :appid - a string representing the OpenWeatherMap API key.

  • :colors - a boolean representing whether or not to colorize the output of the hourly report. Defaults to true.

  • :every_n_hours - an integer representing the hour interval at which data is reported for the hourly report. Defaults to 3.

  • :hours - an integer representing the number of hours to report on for the hourly report. Defaults to 12. Max is 48.

  • :latitude - a float representing the latitude of your location.

  • :longitude - a float representing the longitude of your location.

  • :twelve - a boolean representing whether to use 12-hour time format for the hourly report. Defaults to true. When false, 24-hour time format is used.

  • :units - a string representing the units of measurement. Default is "imperial" (Fahrenheit). Other options are "metric" (Celsius) and "standard" (Kelvin).

Summary

Functions

Create a new Weather.Opts struct, applying defaults where necessary.

Types

@type parsed_args() :: [
  api_key: String.t(),
  colors: boolean(),
  every: integer(),
  hours: integer(),
  latitude: float(),
  longitude: float(),
  twelve: boolean(),
  units: String.t()
]
@type t() :: %Weather.Opts{
  appid: String.t(),
  colors: boolean(),
  every_n_hours: integer(),
  hours: integer(),
  latitude: float(),
  longitude: float(),
  twelve: boolean(),
  units: String.t()
}

Functions

@spec new(parsed_args()) :: t()

Create a new Weather.Opts struct, applying defaults where necessary.