Skip to content

Commit

Permalink
Merge pull request #32 from mlopes/refactor-more
Browse files Browse the repository at this point in the history
Refactor more
  • Loading branch information
mlopes committed May 13, 2019
2 parents d8b2fc2 + 5b106a0 commit e281256
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/scala/wen/types/types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ final case object November extends Month
final case object December extends Month

final object Month {
// We run an unsafe get operation here, because we have a refined int that can
// only be converted to valid Month
def apply(numericMonth: NumericMonth): Month = fromInt(numericMonth.value).get

def fromInt: Int => Option[Month] = {
Expand Down

0 comments on commit e281256

Please sign in to comment.