Skip to content

Instantly share code, notes, and snippets.

@jwinter
Created March 21, 2014 18:37
Show Gist options
  • Select an option

  • Save jwinter/9692891 to your computer and use it in GitHub Desktop.

Select an option

Save jwinter/9692891 to your computer and use it in GitHub Desktop.
class String
include Enumerable
def each(&block)
chars.each do |member|
block.call(member)
end
end
end
@jwinter
Copy link
Author

jwinter commented Mar 21, 2014

class String
  include Enumerable
  alias_method :each, :each_char
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment