Hi everyone, more of a Ruby (vs Rails) question.

I'm debugging this piece of code (using rdebug). It works but I'm just 
digging around, understanding it and rdebug better:

   51      number.scan(/./).map do |digit|
   52        digit(SpecialDigits[digit] || digit, size)
   53      end.transpose.map do |line|
   54        line.join(" ")
   55      end.join("\n")

Here's my question: how would I get the result of the first map? ie the 
resulting array that's been built up by the time the 'end' is reached on 
line 53, but before it enters into the tranpose.map on line 53.

I could break the code apart into 2 sections ie

   51      result = number.scan(/./).map do |digit|
   52        digit(SpecialDigits[digit] || digit, size)
   53      end
   53b    result.transpose.map do |line|

and examine the contents of result. But I'm wondering if there's a 
better way....

-- 
Sonia Hamilton.
http://twitter.com/sonia_hamilton
http://soniahamilton.wordpress.com
http://www.linkedin.com/in/soniahamilton



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to