Skip to content

Instantly share code, notes, and snippets.

@seanpmaxwell
Created October 31, 2018 04:49
Show Gist options
  • Save seanpmaxwell/4ab37136119d23934f6df520bd382c01 to your computer and use it in GitHub Desktop.
Save seanpmaxwell/4ab37136119d23934f6df520bd382c01 to your computer and use it in GitHub Desktop.
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