abstract class Package::Backend::Packaging getter name : String def initialize(@name) end abstract def package(context : Context, package : Package) : Bool def self.install(packages : Array(String)) raise "'install' unimplemented for this backend, yet" end def install(packages : Array(String)) self.install packages end end class Package::Backend::Splitter def initialize(&block : Proc(Recipe, Package)) @callback = block end def create_split(recipe : Recipe) : Package @callback.call recipe end end