Skip to content

Instantly share code, notes, and snippets.

@adambeynon
Last active December 26, 2015 09:09
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