Skip to content

Instantly share code, notes, and snippets.

@NRBPerdijk
Last active April 26, 2019 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NRBPerdijk/eae681fac5c1e060f48d5521c7743d01 to your computer and use it in GitHub Desktop.
Save NRBPerdijk/eae681fac5c1e060f48d5521c7743d01 to your computer and use it in GitHub Desktop.
case class WeatherForecast(
humidity: Percentage,
windForecast: WindForecast,
sunshine: Percentage,
temperature: Temperature,
chanceOfRain: ChanceOfRain
)
case class Temperature(degrees: Int, temperatureScale: String)
case class Percentage(percent: Double)
case class WindForecast(windSpeed: WindSpeed, direction: String)
case class WindSpeed(scale: String, speed: Int)
case class ChanceOfRain(chance: Percentage)
case class WeatherForecastList(asScalaList: List[WeatherForecast]) {
def add(weatherForecast: WeatherForecast): WeatherForecastList =
this.copy(weatherForecast :: asScalaList)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment