--- /dev/null
+package net.pterodactylus.rhynodge.webpages.weather
+
+/**
+ * The direction the wind comes from.
+ *
+ * @author [David ‘Bombe’ Roden](mailto:bombe@pterodactylus.net)
+ */
+enum class WindDirection(val arrow: String) {
+
+ NONE("↺"),
+ NORTH("↓"),
+ NORTHEAST("↙"),
+ EAST("←"),
+ SOUTHEAST("↖"),
+ SOUTH("↑"),
+ SOUTHWEST("↗"),
+ WEST("→"),
+ NORTHWEST("↘")
+
+}
+
+fun String.toWindDirection(): WindDirection {
+ return when (this) {
+ "N" -> WindDirection.NORTH
+ "NO" -> WindDirection.NORTHEAST
+ "O" -> WindDirection.EAST
+ "SO" -> WindDirection.SOUTHEAST
+ "S" -> WindDirection.SOUTH
+ "SW" -> WindDirection.SOUTHWEST
+ "W" -> WindDirection.WEST
+ "NW" -> WindDirection.NORTHWEST
+ else -> WindDirection.NONE
+ }
+}
package net.pterodactylus.rhynodge.webpages.weather.wettercom
import com.fasterxml.jackson.annotation.JsonProperty
+import net.pterodactylus.rhynodge.webpages.weather.WindDirection
/**
* Container for weather conditions of a single hour.
import net.pterodactylus.rhynodge.State
import net.pterodactylus.rhynodge.states.FailedState
import net.pterodactylus.rhynodge.states.HtmlState
+import net.pterodactylus.rhynodge.webpages.weather.toWindDirection
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.time.LocalDateTime
+++ /dev/null
-package net.pterodactylus.rhynodge.webpages.weather.wettercom
-
-/**
- * The direction the wind comes from.
- *
- * @author [David ‘Bombe’ Roden](mailto:bombe@pterodactylus.net)
- */
-enum class WindDirection(val arrow: String) {
-
- NONE("↺"),
- NORTH("↓"),
- NORTHEAST("↙"),
- EAST("←"),
- SOUTHEAST("↖"),
- SOUTH("↑"),
- SOUTHWEST("↗"),
- WEST("→"),
- NORTHWEST("↘")
-
-}
-
-fun String.toWindDirection(): WindDirection {
- return when (this) {
- "N" -> WindDirection.NORTH
- "NO" -> WindDirection.NORTHEAST
- "O" -> WindDirection.EAST
- "SO" -> WindDirection.SOUTHEAST
- "S" -> WindDirection.SOUTH
- "SW" -> WindDirection.SOUTHWEST
- "W" -> WindDirection.WEST
- "NW" -> WindDirection.NORTHWEST
- else -> WindDirection.NONE
- }
-}
import net.pterodactylus.rhynodge.filters.ResourceLoader.loadDocument
import net.pterodactylus.rhynodge.states.FailedState
import net.pterodactylus.rhynodge.states.HtmlState
+import net.pterodactylus.rhynodge.webpages.weather.WindDirection
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.`is`
import org.hamcrest.Matchers.contains
package net.pterodactylus.rhynodge.webpages.weather.wettercom
import com.fasterxml.jackson.databind.ObjectMapper
+import net.pterodactylus.rhynodge.webpages.weather.WindDirection
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.`is`
import org.junit.Test
package net.pterodactylus.rhynodge.webpages.weather.wettercom
import net.pterodactylus.rhynodge.Reaction
+import net.pterodactylus.rhynodge.webpages.weather.WindDirection
import org.hamcrest.MatcherAssert.assertThat
import org.hamcrest.Matchers.`is`
import org.hamcrest.Matchers.containsString