On Mon, Jul 27, 2009 at 11:15 PM,
RichardOnRails<RichardDummyMailbox58407 / uscomputergurus.com> wrote:
> Hi,,
>
> I putting together examples I might use in teaching an elementary Ruby
> seminar.  ¨Βος τθνονεξτμιλε το γοδε εψανπμεσ ιξσιδε νετθοδ τθατ
> displays both the code and the result of the code's execution.
>
> I pasted both the code and the output presented by running the code
> under SciTE at http://www.pastie.org/561156.
>
> My problem is the spurious final line of output from the show method:
> "1256921" from Example 4.  ¨Β μιλε το μεαςχθτθατ§σ ηεξεςατεσο
> that I can eliminate it.  ¨Β ςεπεατεδ τθΕψανπμγοδε ουοζ τθ> "show" context,  ¨Βξδ ιτ εψεγυτεδ ασ εψπεγτεδι®ε® ξο Ά±²µ¶Ή²±χσ
> generated.

this is because the return value of your eval() code is the last
statement executed, which is Array#each

>> [1,2,3].each { }.to_s
=> "123"