"QUESTION 2: The second part of this code is just plain confusing me,
perhaps because I still can't figure out the first part which it builds
upon."

The code example is not very elegant.

Keep this in mind when reading other people's code - their style may not 
be beautiful.

Almost always, when you see lots of if/else, you may be better off using 
case/when instead:


if write > 0
  if    write == 1
    numString = numString + 'one'
  elsif write == 2
    numString = numString + 'two'
  end
end

Would be like this in case/when:

case write
when 1
  numString += 'one'
when 2
  numString += 'two'
end if write > 0 # though this if condition is not needed. Actually, I 
argue that the if write > 0 in the original example is useless too. So 
ebst omit the "if write > 0" also here.

-- 
Posted via http://www.ruby-forum.com/.