ES6 OOP Exercise
Setup all required classes and subclasses of the animal kingdom.
Make tests pass.
npm install
gulp
all class files will be saved to the lib/
subdirectory.
each class file will be named after it's class name, for example the Protista
class will be saved in lib/Protista.js
each class file will define only one class, and export it as default
defined with the following parameters
- name
- uniCellular
- trueNucleus
- anaerobic
- asexual
- mobile
declares and assigns the following private properties
- _name = name
- _uniCellular = uniCellular
- _trueNucleus = trueNucleus
- _anaerobic = anaerobic
- _asexual = asexual
- _mobile = mobile
- should have a method named
name
that returns the value of the private property_name
- should have a method named
name
that sets the value of the private property_name
- should have a method named
uniCellular
that returns a boolean value based on the private property_uniCellular
- should have a method named
uniCellular
that sets the value of the private property_uniCellular
- should have a method named
multiCellular
that returns a boolean value based on the private property_uniCellular
- should have a method named
multiCellular
that sets the value of the private property_uniCellular
- should have a method named
eukaryote
that returns a boolean value based on the private property_trueNucleus
- should have a method named
eukaryote
that sets the value of the private property_trueNucleus
- should have a method named
prokaryote
that returns a boolean value based on the private property_trueNucleus
- should have a method named
prokaryote
that sets the value of the private property_trueNucleus
- should have a method named
anaerobic
that returns a boolean value based on the private property_anaerobic
- should have a method named
anaerobic
that sets the value of the private property_anaerobic
- should have a method named
aerobic
that returns a boolean value based on the private property_anaerobic
- should have a method named
aerobic
that sets the value of the private property_anaerobic
- should have a method named
asexual
that returns a boolean value based on the private property_asexual
- should have a method named
asexual
that sets the value of the private property_asexual
- should have a method named
sexual
that returns a boolean value based on the private property_asexual
- should have a method named
sexual
that sets the value of the private property_asexual
- should have a method named
mobile
that returns a boolean value based on the private_mobile
- should have a method named
mobile
that sets the value of the private_mobile
- should have a method named
immobile
that returns a boolean value based on the private ` - should have a method named
immobile
that sets the value of the private_mobile
is a subclass of LivingThing
defined with the following parameters
- name
invokes the super constructor with all required arguments using the following hard coded values
- uniCellular = true
- trueNucleus = false
- anaerobic = true
- asexual = true
- mobile = false
is a subclass of LivingThing
defined with the following parameters
- name
invokes the super constructor with all required arguments using the following hard coded values
- uniCellular = true
- trueNucleus = false
- anaerobic = false
- asexual = true
- mobile = false
is a subclass of LivingThing
defined with the following parameters
- name
- uniCellular
- asexual
- mobile
- heterotroph
invokes the super constructor with all required arguments using the following hard coded values
- trueNucleus = true
- anaerobic = false
declares and assigns the following private properties
- _heterotroph = heterotroph
- should have a method named
heterotroph
that returns a boolean value based on the private property_heterotroph
- should have a method named
heterotroph
that sets the value of the private property_heterotroph
- should have a method named
autotroph
that returns a boolean value based on the private property_heterotroph
- should have a method named
autotroph
that sets the value of the private property_heterotroph
is a subclass of Eukaryota
defined with the following parameters
- name
invokes the super constructor with all required arguments using the following hard coded values
- uniCellular = false
- asexual = true
- mobile = false
- heterotroph = true
is a subclass of Eukaryota
defined with the following parameters
- name
- uniCellular
- mobile
- heterotroph
invokes the super constructor with all required arguments using the following hard coded values
- asexual = true
is a subclass of Eukaryota
defined with the following parameters
- name
invokes the super constructor with all required arguments using the following hard coded values
- uniCellular = false
- asexual = true
- mobile = false
- heterotroph = false
is a subclass of Eukaryota
defined with the following parameters
- name
- symmetry
invokes the super constructor with all required arguments using the following hard coded values
- uniCellular = false
- asexual = false
- mobile = true
- heterotroph = true
declares and assigns the following private properties
- _symmetry = symmetry
- should have a method named
symmetry
that returns a string value based on the private property_symmetry
- should have a method named
symmetry
that sets the value of the private property_symmetry
is a subclass of Animal
defined with the following parameters
- name
invokes the super constructor with all required arguments using the following hard coded values
- symmetry = 'radial'
is a subclass of Animal
defined with the following parameters
- name
- body
invokes the super constructor with all required arguments using the following hard coded values
- symmetry = 'bilateral'
declares and assigns the following private properties
- _body = body
- should have a method named
body
that returns a string value based on the private property_body
- should have a method named
body
that sets the value of the private property_body
is a subclass of Bilateral
defined with the following parameters
- name
invokes the super constructor with all required arguments using the following hard coded values
- body = 'soft-bodied'
is a subclass of Bilateral
defined with the following parameters
- name
invokes the super constructor with all required arguments using the following hard coded values
- body = 'exoskeleton'
is a subclass of Bilateral
defined with the following parameters
- name
invokes the super constructor with all required arguments using the following hard coded values
- body = 'vertebral-column'
Play with instantiating objects in ./example/index.js
there is one example of each class already written
gulp run