Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Commit

Permalink
Added example data
Browse files Browse the repository at this point in the history
  • Loading branch information
devmaximilian committed Feb 12, 2021
1 parent 02c64d0 commit 32986cf
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Sources/Weather/Models/Forecast.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,24 @@ public struct Forecast: Decodable {
return self.get(name)[keyPath: keyPath]
}
}

#if DEBUG
extension Forecast {
public static var example: Forecast {
return Forecast(
validTime: Date(),
parameters: [
Parameter(
name: .t,
levelType: .unknown,
level: 0,
unit: "Cel",
values: [
Double.random(in: -10...10)
]
)
]
)
}
}
#endif

0 comments on commit 32986cf

Please sign in to comment.