# Code Review: ExplicitIfaces

**URL:** <https://www.ruby-forum.com/t/code-review-explicitifaces/177170>\
**Category:** IronRuby\
**Created:** [October 12, 2009, 9:00pm UTC](https://www.ruby-forum.com/t/code-review-explicitifaces/177170 "2009-10-12T21:00:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![grujildo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/94ad74/32.png) [@grujildo](https://www.ruby-forum.com/u/grujildo)\
**Post date:** [October 12, 2009, 9:00pm UTC](https://www.ruby-forum.com/t/code-review-explicitifaces/177170/1 "2009-10-12T21:00:02Z")

</div>

tfpt review “/shelveset:ExplicitIfaces;REDMOND\tomat”  
Comment :  
Generalizes clr\_member to support calls to an explicit implementation  
of an interface method as well as a base class method hidden by a “new  
slot” method.

1. interfaces

public interface I {  
int Foo();  
}

public interface J {  
int Foo();  
}

class C : I, J {  
int I.Foo() { return 1; }  
int J.Foo() { return 2; }  
}

C.new.foo # =\> undefined method `foo’  
C.new.clr\_member(I, :foo).call # =\> 1  
C.new.clr\_member(J, :foo).call # =\> 2

1. new slot methods

c = C.new  
p c.foo # =\> 2  
p c.clr\_member(B, :foo).call # =\> 1

Tomas
