Skip to content

Instantly share code, notes, and snippets.

@raggi
Created July 29, 2009 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raggi/158045 to your computer and use it in GitHub Desktop.
Save raggi/158045 to your computer and use it in GitHub Desktop.
Should this work? Do you know what it's doing?
# The Question: Should this work?
# The Bonus Question: Does it, and in what capacity?
def parse_message(str)
last = nil
@parser ||= Parser.new { |message| last = message }
@parser << str
last
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment