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
# Notify Slack - Send notifications to a Slack Channel | |
# | |
# Original script from: | |
# Copyright (C) 2016 Gustavo Arjones (@arjones) | |
# | |
# Some configuration and notification changes were added by: | |
# 2017 Maximiliano Felice | |
# | |
# This program is free software; you can redistribute it and/or | |
# modify it under the terms of the GNU General Public License |
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
case class Food(ingredients: Seq[String]) | |
class Chef[Pizza <: Chef.Pizza] protected (ingredients: Seq[String]) { | |
import Chef.Pizza._ | |
def addCheese(cheeseType: String): Chef[Pizza with Cheese] = Chef(ingredients :+ cheeseType) | |
def addTopping(toppingType: String): Chef[Pizza with Topping] = Chef(ingredients :+ toppingType) | |
def addDough: Chef[Pizza with Dough] = Chef(ingredients :+ "dough") |
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
class Chef[Pizza <: Chef.Pizza](ingredients: Seq[String]) { | |
import Chef.Pizza._ | |
def addCheese(cheeseType: String): Chef[Pizza with Cheese] = new Chef(ingredients :+ cheeseType) | |
def addTopping(toppingType: String): Chef[Pizza with Topping] = new Chef(ingredients :+ toppingType) | |
def addDough: Chef[Pizza with Dough] = new Chef(ingredients :+ "dough") | |
def build(implicit ev: Pizza =:= FullPizza): Food = Food(ingredients) |