Skip to content

Instantly share code, notes, and snippets.

@adambeynon
Last active December 26, 2015 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adambeynon/7127501 to your computer and use it in GitHub Desktop.
Save adambeynon/7127501 to your computer and use it in GitHub Desktop.
wrapper override
class Array::Wrapper
def self.inherited(subclass)
real_subclass = Class.new(Array::Wrapper)
%x{
subclass._proto = real_subclass._proto;
subclass._alloc = real_subclass._alloc;
subclass.$new = real_subclass.$new;
subclass['$[]'] = real_subclass['$[]'];
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment