In this type of case I'd strongly suggest looking into making a class for
subject, it saves quite a bit of time in the long run versus a hacked
together hash. As more grades and subjects are added the Hash will become
slower and more confounded to use.
I also don't entirely understand the reasoning behind your layout. Subject
should not be on the same level with the student/grade pair. It doesn't
make sense in that manner. If we put it in bullet points it's a little
clearer:
*BAD*
- Grades
- Subject
- Student
- Grade
*GOOD*
···
*
*
- Grades
- Subject
- Students
Again, the current hierarchy makes no sense. and it would be far easier to
manipulate with a clearer structure that cleanly separates different types
of data.
The basic frame for a class would be: Grades contain many subjects, each
with several students that all have one grade. This can easily change of
course, but with the one grade system it works.
On Mon, Dec 10, 2012 at 4:58 PM, 7stud -- <lists@ruby-forum.com> wrote: