Last active
December 12, 2015 03:18
-
-
Save JRJurman/4705231 to your computer and use it in GitHub Desktop.
META PROGRAMMING!
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 Meta_Buffer | |
| def save | |
| puts "no modifications" | |
| end | |
| def read | |
| "" | |
| end | |
| def write( str ) | |
| eval(" | |
| def save | |
| def save | |
| puts \"no modifications\" | |
| end | |
| def read | |
| \"#{read + str}\" | |
| end | |
| end | |
| ") | |
| end | |
| end |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The eval lets me write a hard coded method with the arguments passed in through write( str ).