View raw

1 " 2 I represent a single working set. 3 " 4 Class { 5 #name : 'MFTStraightSetGroupPrescription', 6 #superclass : 'MFTSetGroupPrescription', 7 #category : 'MyFitnessTracker-Core-Prescription', 8 #package : 'MyFitnessTracker-Core', 9 #tag : 'Prescription' 10 } 11 12 { #category : 'as yet unclassified' } 13 MFTStraightSetGroupPrescription class >> with: aMFTSetPrescription [ 14 15 ^ self new 16 sets: (OrderedCollection with: aMFTSetPrescription); 17 validate; 18 yourself 19 ] 20 21 { #category : 'initialization' } 22 MFTStraightSetGroupPrescription >> canonicalName [ 23 24 ^ 'straight set' 25 ] 26 27 { #category : 'validation' } 28 MFTStraightSetGroupPrescription >> validate [ 29 30 sets size = 1 ifFalse: [ 31 self error: 'Straight group must have exactly 1 set.' ] 32 ] 33