Created
May 17, 2012 21:08
-
-
Save wilmoore/2721603 to your computer and use it in GitHub Desktop.
Inheritance & Composition playing nice in 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
| module StorageAgnostic | |
| class FileStore | |
| # common filestore methods | |
| end | |
| class LocalFilesystem < FileStore | |
| # optionally override common filestore methods for special needs | |
| end | |
| class RackspaceCloud < FileStore | |
| include HttpTransport | |
| include AuthHttpBasic | |
| # optionally override common filestore methods for special needs | |
| end | |
| class GoogleDrive < FileStore | |
| include HttpTransport | |
| include AuthOauth | |
| # optionally override common filestore methods for special needs | |
| end | |
| class AmazonS3 < FileStore | |
| include S3FlavoredRestHttpTransport | |
| include AuthCustomHttpHeaders | |
| # optionally override common filestore methods for special needs | |
| end | |
| end |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://groups.google.com/forum/#!forum/objects-on-rails