Skip to content

Instantly share code, notes, and snippets.

@JiriChara
Created July 2, 2014 11:50
Show Gist options
  • Save JiriChara/2ad4eb62ed15d654cb08 to your computer and use it in GitHub Desktop.
Save JiriChara/2ad4eb62ed15d654cb08 to your computer and use it in GitHub Desktop.
Bit of Meta-programming
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
@martinblaha
Copy link

Holy sh... nice piece of ... aaaahhhh, what is btw?
:-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment