Skip to content

Commit

Permalink
Implement Module#<
Browse files Browse the repository at this point in the history
  • Loading branch information
adambeynon committed Oct 9, 2013
1 parent cda417c commit a234c9b
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions corelib/module.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ def ===(object)
}
end

def <(other)
%x{
var working = self;
while (working) {
if (working === other) {
return true;
}
working = working.__parent;
}
return false;
}
end

def alias_method(newname, oldname)
%x{
#{self}._proto['$' + newname] = #{self}._proto['$' + oldname];
Expand Down

0 comments on commit a234c9b

Please sign in to comment.