Created
September 4, 2011 15:09
-
-
Save tatzyr/1192986 to your computer and use it in GitHub Desktop.
Rubyを便利/カオスに
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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