Sorry.  Neglected to provide the literal answer to your question.
Because of the incorrect placement of "end"s, your definition of
"scanning" actually occurred within another one of your method
definitions.  I hadn't tried that before but, unsurprisingly, it has
the net effect of making your "method within a method" private.