Dear list members,
A beginner’s question:
I wrote a simple programme that assembles exams, choosing the questions
from a database according to certain criteria. The programme does what I
want, but I realised there are certain basic things I don’t understand,
My programme has classes analogous to class Song and class SongList in
the pickaxe book (class Question and class QuestionList).
Class QuestionList includes the definition
and that, of course, works.
When, instead of that definition, I make class QuestionList a subclass
of Array (QuestionList < Array), asking for the length doesn’t give me
an error, but returns a length of 0. So “length” doesn’t know what to do
with an instance of QuestionList, although the latter class includes
@questions = Array.new
and is now a subclass of “Array”.
Why not? Thanks for answers,
Prof.Dr.med. Jörg Hagmann-Zanolari
Institute of Biochemistry and Genetics
Centre of Biomedicine, University of Basel
Phone +41 (0)61 267 3565