Created
September 26, 2011 16:28
-
-
Save nwjsmith/1242659 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
module Formattable | |
def format(opts) | |
# ... | |
end | |
end | |
class Basketball::PlayerRecord | |
extend Formattable | |
format :fields =>[:rebounds_total, :minutes, :assists, :points], :with => '-' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
To illustrate my idea, here is some more code exploring the method_missing, following a method protocol.
Advantage:
Drawback: