A more ruby esque encode method.

IMHO, this looks more like ruby like to me. Just submitting for now to start the conversation.