Skip to content

Instantly share code, notes, and snippets.

@nurkiewicz
Created December 2, 2012 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nurkiewicz/ea5e46a2f392204993fa to your computer and use it in GitHub Desktop.
Save nurkiewicz/ea5e46a2f392204993fa to your computer and use it in GitHub Desktop.
sealed trait ResizedImageKey {
def getDimension(originalDimension: Dimension): Dimension
}
case object Large extends ResizedImageKey {
def getDimension(originalDimension: Dimension) = Dimension(1000,1000)
}
case object Medium extends ResizedImageKey{
def getDimension(originalDimension: Dimension) = Dimension(500,500)
}
case object Small extends ResizedImageKey{
def getDimension(originalDimension: Dimension) = Dimension(100,100)
}
case class Dimension(width: Int, height: Int)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment