Created
October 20, 2017 13:48
-
-
Save Groogy/f03dcc1a5cac38bc2e54c766f2ba1d30 to your computer and use it in GitHub Desktop.
This file contains 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
abstract class Container < Widget | |
includes CrystalClear | |
@children = [] of Widget | |
requires child.parent.nil? | |
ensures @children.count child == 1 | |
def add(child) | |
@children << child | |
child.parent = self | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment