Created
May 8, 2014 16:29
-
-
Save chadbailey59/651c1ce89870f3b5c04f 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
def method_missing(meth, *args, &block) | |
if meth.to_s ~= /^([a-z]+)_v(\d)_json$/ | |
# add version to args | |
args << $2 | |
self.send("#{$1}_json", args) | |
else | |
super | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment