Created
November 29, 2014 13:07
-
-
Save KamilLelonek/e85e16965845ee028509 to your computer and use it in GitHub Desktop.
Startpakker features
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
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