Created
September 15, 2010 21:24
-
-
Save pete/581516 to your computer and use it in GitHub Desktop.
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
| # This file was written so that this line of code would do a valid thing in | |
| # Ruby: | |
| # Object.effect.affect('@genuflect', :circumspect).collect { |object| object.respect! } | |
| # I'm very sorry, everyone. | |
| class Class | |
| alias_method :effect, :new | |
| class << self; alias_method :architect, :new; end | |
| end | |
| class Object | |
| alias_method :subject, :send | |
| alias_method :subjects, :methods | |
| alias_method :respect!, :freeze | |
| alias_method :protect, :freeze | |
| alias_method :infect, :taint | |
| alias_method :project, :to_s | |
| def affect(iv, val) | |
| instance_variable_set iv, val | |
| self | |
| end | |
| def each(&b) | |
| instance_variables.map { |iv| instance_variable_get iv }.each &b | |
| end | |
| include Enumerable | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment