Skip to content

Instantly share code, notes, and snippets.

@apeckham
Created January 19, 2009 21:02
Show Gist options
  • Save apeckham/49172 to your computer and use it in GitHub Desktop.
Save apeckham/49172 to your computer and use it in GitHub Desktop.
Delegate all methods
class BrowsePage
attr_reader :collection
def initialize(collection)
@collection = collection
end
def method_missing(method, *args, &block)
@collection.send method, *args, &block
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment