Skip to content

Instantly share code, notes, and snippets.

@tatzyr
Created September 4, 2011 15:09
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 tatzyr/1192986 to your computer and use it in GitHub Desktop.
Save tatzyr/1192986 to your computer and use it in GitHub Desktop.
Rubyを便利/カオスに
class Object
def d
p self
end
end
class String
alias / split
alias each each_line
include Enumerable
end
class Integer
def enumerate
return to_enum(:enumerate) unless block_given?
1.upto(self) do |i|
yield i
end
self
end
alias each enumerate
include Enumerable
end
module Enumerable
alias with each_with_object
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment