Skip to content

Instantly share code, notes, and snippets.

@texel
Created December 10, 2009 03:11
Show Gist options
  • Save texel/253085 to your computer and use it in GitHub Desktop.
Save texel/253085 to your computer and use it in GitHub Desktop.
class Foo
def initialize
self.collection = []
collection.extend Finder
end
end
module Finder
def [](name)
find { |e| e.name == name } || super
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment