Created
October 31, 2018 04:49
-
-
Save seanpmaxwell/4ab37136119d23934f6df520bd382c01 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
class Dog | |
{ | |
private _weight: number | |
static readonly SPECIES = 'canis familiaris' | |
static readonly TAXONOMY: Taxonomy = taxonomiesModule(this.SPECIES) | |
set weight(weight: number): void | |
{ | |
this._weight = weight | |
} | |
get weight(): any <--AVOID | |
{ | |
return this._weight | |
} | |
calcDailyPills(mgDaily: number): number | |
{ | |
let weightKilos = this._weight * 0.45 | |
let mgPerPill = 10 | |
return (weightKilos * mgDaily) / mgPerPill | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment