Created
August 20, 2020 10:27
-
-
Save Moverr/1c2ea53401494642aa0474c60dacc612 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
object StructuringInformation{ | |
sealed trait Calendar | |
case object months extends Calendar | |
case object weeks extends Calendar | |
case object days extends Calendar | |
def getme(calendar:Calendar): Any={ | |
calendar match { | |
case `months` => monthsoftheyear | |
case `weeks` => weekoftheyear | |
case `days` => daysofweek | |
} | |
} | |
def monthsoftheyear = "JAN FEB MARCH APRIL MAY JUNE JULY AUGUST SEPTEMBER OCTOBER NOVEMBER DECEMBER " | |
def weekoftheyear = 12345 | |
def daysofweek = "monday tuesday wednesday thursday friday saturday sunday " | |
def main(args:Array[String]): Unit={ | |
println("Test me out mover") | |
println(getme(days)) | |
println(getme(weeks)) | |
println(getme(months)) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment