IronRuby.Builtins.RubyObject.Equals C# (CSharp) Method

Equals() public method

public Equals ( object other ) : bool
other object
return bool
        public override bool Equals(object other) {
            if (ReferenceEquals(this, other)) {
                // Handle this directly here. Otherwise it can cause infinite recurion when running
                // script code below as the DLR code needs to call Equals for templating of rules
                return true;
            }
            
            var site = _immediateClass.EqualsSite;
            object equalsResult = site.Target(site, this, other);
            if (equalsResult == RubyOps.ForwardToBase) {
                return base.Equals(other);
            }

            return RubyOps.IsTrue(equalsResult);
        }