Last active
April 26, 2019 13:41
-
-
Save NRBPerdijk/eae681fac5c1e060f48d5521c7743d01 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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