Skip to content

Instantly share code, notes, and snippets.

@KamilLelonek
Created November 29, 2014 13:07
Show Gist options
  • Save KamilLelonek/e85e16965845ee028509 to your computer and use it in GitHub Desktop.
Save KamilLelonek/e85e16965845ee028509 to your computer and use it in GitHub Desktop.
Startpakker features
def startpakkerCountForTelenor = startpakkerCount(Brands.Telenor)
def startpakkerCountForCBB = startpakkerCount(Brands.CBB)
def startpakkerCountForOne = startpakkerCount(Brands.One)
def startpakkerCountForColour = startpakkerCount(Brands.Colour)
private def startpakkerCount(brand: Brand) = startpakkerForBrand(brand) match {
case None => None
case Some(list) => Some(list.size)
}
def startpakkerForTelenor = startpakkerForBrand(Brands.Telenor)
def startpakkerForCBB = startpakkerForBrand(Brands.CBB)
def startpakkerForOne = startpakkerForBrand(Brands.One)
def startpakkerForColour = startpakkerForBrand(Brands.Colour)
private def startpakkerForBrand(brand: Brand) = startpakker.get(brand)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment