Skip to content

Commit 28a43a9

Browse files
committed
extract scoreSmoking function at Score
1 parent b979164 commit 28a43a9

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/index.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ export class Scorer {
1414
this._healthLevel = 0;
1515
this._highMedicalRiskFlag = false;
1616

17-
if (this._medicalExam.isSmoker) {
18-
this._healthLevel += 10;
19-
this._highMedicalRiskFlag = true;
20-
}
17+
this.scoreSmoking();
2118

2219
this._certificationGrade = 'regular';
2320
if (this._scoringGuide.stateWithLowCertification(this._candidate.originState)) {
@@ -30,4 +27,11 @@ export class Scorer {
3027

3128
return this._result;
3229
}
30+
31+
scoreSmoking() {
32+
if (this._medicalExam.isSmoker) {
33+
this._healthLevel += 10;
34+
this._highMedicalRiskFlag = true;
35+
}
36+
}
3337
}

0 commit comments

Comments
 (0)