The wizarding world has been around for ages, this system even more so.
-> To send acceptance letters to students regarding which magic school they have been accepted at.
A school offers different courses(school_data.json -> ["school"]["courses"]) and a list of ratings for each course(school_data.json -> ["school"][:course_rating]) these ratings are out of 100.
A child when applying to the school should submit his name and at least 5 subjects he is interested in,
the order of the subjects coincides with a list of all the subjects available(School::COURSES).
We compare the list of interest scores a student submits to each schools list of courses offered and their rating.
The code is centuries old and needs a fair amount of refactoring.
Use all the knowledge at your disposal to manage the dependencies wisely.
You will need access to ruby. All versions of OSX will have it, you will also need:
-
rspec -
gem install rspec -
byebug -
gem install byebug -
There is a spec written. you can run it by calling
bin/rspec test.rb -
Debuggers are also suggested if you have
byebuginstalled you can easily debug the code by addingrequire 'byebug'at the top of the test.rb file. -
You can
- rename / add files
- change the data structure in the
- Start with the simple tricks learnt today -. Extraction Method -. Method Object -. Dependancy Injection
-> Identify in words how the system calculates a score. -> Use all three of the refactoring tips.