Created
July 25, 2019 15:31
-
-
Save edcrypt/feddaa3414329aae9b257bf8decae194 to your computer and use it in GitHub Desktop.
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
Object subclass: #Artist | |
instanceVariableNames: 'tracks' | |
methods for: 'initialising' | |
initialize | |
tracks := OrderedCollection new. | |
^self | |
methods for: 'checking' | |
invariant | |
^(tracks isMemberOf: OrderedCollection) and: [ | |
tracks allSatisfy: [:each | each isKindOf: Track]] | |
methods for: 'accessing tracks' | |
addTrack: aTrack. | |
tracks add: aTrack. | |
^track | |
tracksDo: doBlock | |
tracks do: doBlock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment