Skip to content

Instantly share code, notes, and snippets.

@binford2k
Last active January 3, 2016 03:39
Show Gist options
  • Save binford2k/8403860 to your computer and use it in GitHub Desktop.
Save binford2k/8403860 to your computer and use it in GitHub Desktop.
Demonstrate composition instead of inheritance
################### don't do this ###################
node default {
include something
include something else
}
node 'boo' inherits default {
include a third thing
}
################ instead, do this ###################
class base {
include something
include something else
}
node default {
include base
}
node 'boo' {
include base
include a third thing
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment