" I am a rep range used when prescribing workout sets. " Class { #name : 'MFTRepScheme', #superclass : 'MFTObject', #instVars : [ 'minReps', 'maxReps' ], #category : 'MyFitnessTracker-Core-Prescription', #package : 'MyFitnessTracker-Core', #tag : 'Prescription' } { #category : 'instance creation' } MFTRepScheme class >> from: min to: max [ ^ self new minReps: min; maxReps: max; yourself ] { #category : 'comparing' } MFTRepScheme >> = anObject [ "Answer whether the receiver and anObject represent the same object." self == anObject ifTrue: [ ^ true ]. self class = anObject class ifFalse: [ ^ false ]. ^ minReps = anObject minReps and: [ maxReps = anObject maxReps ] ] { #category : 'initialization' } MFTRepScheme >> canonicalName [ ^ minReps asString , '–' , maxReps asString ] { #category : 'comparing' } MFTRepScheme >> hash [ "Answer an integer value that is related to the identity of the receiver." ^ minReps hash bitXor: maxReps hash ] { #category : 'testing' } MFTRepScheme >> includes: repsAchieved [ ^ repsAchieved between: minReps and: maxReps ] { #category : 'accessing' } MFTRepScheme >> maxReps [ ^ maxReps ] { #category : 'accessing' } MFTRepScheme >> maxReps: anInteger [ maxReps := anInteger ] { #category : 'accessing' } MFTRepScheme >> minReps [ ^ minReps ] { #category : 'accessing' } MFTRepScheme >> minReps: anInteger [ minReps := anInteger ] { #category : 'testing' } MFTRepScheme >> progressionFor: repsAchieved [ repsAchieved > maxReps ifTrue: [ ^ #increaseLoad ]. repsAchieved < minReps ifTrue: [ ^ #decreaseLoad ]. ^ #keepLoad ]