Created
April 28, 2011 02:32
-
-
Save ivanacostarubio/945679 to your computer and use it in GitHub Desktop.
a piece on Ruby history
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
| # FREEDOM PATCHING | |
| # because monkeys have right | |
| # http://vimeo.com/17420638 | |
| class Object | |
| def has_attached_file(attribute, options={}) | |
| puts attribute | |
| # WE CAN DO FANCY STUFF HERE | |
| end | |
| end | |
| # OBJECT IS A TOP LEVEL CLASS SO WE CAN CALL IT FROM HERE | |
| has_attached_file("On" + self.class.to_s) | |
| class Tickets # THIS CAN INHERIT FROM EVERYTHING. THAT INCLUDES ACTIVE RECORD | |
| # OR WE CAN CALL IT FROM HERE | |
| has_attached_file("On " + self.class.to_s) | |
| end | |
| Tickets.new | |
| class User | |
| def initialize | |
| # WE CAN LEVERAGE THE INITIALIZE METHOD | |
| has_attached_File("On " + self.class.to_s) | |
| end | |
| end | |
| Ticket.new | |
| # RELIGION WARS HAVE BEEN FOUGHT FOR THE CONCEPTS EXPRESSED HERE | |
| # AVOID WHEN POSIBLE / USE AT YOUR OWN RISK |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment