Skip to content

Instantly share code, notes, and snippets.

@tdreyno
Created November 16, 2009 19:04
Show Gist options
  • Save tdreyno/236218 to your computer and use it in GitHub Desktop.
Save tdreyno/236218 to your computer and use it in GitHub Desktop.
class Sinatra::Base
# not my code
def self.get(url, *args)
# method body
end
# my code
def self.with_layout(url, layout, &block)
# Basically, I want to call get, but with additional args appended
Generic.class_eval(&block)
end
end
class Generic
def self.get(url)
Sinatra::Base.get(url, { :layout => "whatever" })
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment