Skip to content

Instantly share code, notes, and snippets.

@caseykulm
Created September 7, 2017 14:25
Show Gist options
  • Save caseykulm/12e7f0a5bf0043b704acf94971842a8a to your computer and use it in GitHub Desktop.
Save caseykulm/12e7f0a5bf0043b704acf94971842a8a to your computer and use it in GitHub Desktop.
Inject Functions: 3
interface TreatFactory {
fun getTreats(): Treats
}
class PetsMart: TreatFactory {
fun getTreats(): Treats {
// Petsmart details
}
}
class HoomansBed: TreatFactory {
fun getTreats(): Treats {
// look under the pillows
}
}
val treatFactory1 = PetsMart()
val treatFactory2 = HoomansBed()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment