Created
July 2, 2014 11:50
-
-
Save JiriChara/2ad4eb62ed15d654cb08 to your computer and use it in GitHub Desktop.
Bit of 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
def data(*args) | |
d = super | |
old_url = d.method(:url) | |
(class << d; self; end).send(:define_method, :url) do |*params| | |
File.join(OM::Application.config.om.root_url, old_url.call(*params)) | |
end | |
return d | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Holy sh... nice piece of ... aaaahhhh, what is btw?
:-)