# Code Review: MethodLookup

**URL:** <https://www.ruby-forum.com/t/code-review-methodlookup/150403>\
**Category:** IronRuby\
**Created:** [October 8, 2008, 6:26am UTC](https://www.ruby-forum.com/t/code-review-methodlookup/150403 "2008-10-08T06:26:52Z")\
**Posts on this page:** 4\
**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 8, 2008, 6:26am UTC](https://www.ruby-forum.com/t/code-review-methodlookup/150403/1 "2008-10-08T06:26:52Z")

</div>

tfpt review “/shelveset:MethodLookup;REDMOND\tomat”

‘alias’ keyword, alias\_method and public/private/protected methods look  
the method up in Object if called on a module, which we didn’t do  
Also, ‘super’ keyword doesn’t use current ‘self’ if called in  
class\_eval/instance\_eval.

Tomas

---

<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 8, 2008, 6:53am UTC](https://www.ruby-forum.com/t/code-review-methodlookup/150403/2 "2008-10-08T06:53:47Z")

</div>

Changes are largely good. The change involving  
MetaObjectBuilder.TreatRestrictionsAsConditions is pretty awkward, but  
I’m sure you think so too and there don’t seem to be any terribly clean  
alternatives.

In the case we were looking at earlier today, will  
ResolveMethodFallbackToObject find Module.freeze or only Object.freeze?

---

<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 8, 2008, 8:11am UTC](https://www.ruby-forum.com/t/code-review-methodlookup/150403/3 "2008-10-08T08:11:36Z")

</div>

Yes, TreatRestrictionsAsConditions is a little ugly, but I don’t see any  
much cleaner way how to achieve the same.

I don’t remember the exact details, let’s revisit it tomorrow.

Tomas

---

<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 9, 2008, 10:56am UTC](https://www.ruby-forum.com/t/code-review-methodlookup/150403/4 "2008-10-09T10:56:37Z")

</div>

I ran my test case against MRI and determined that MRI itself would only  
find Object.freeze under these circumstances. I suspect that the  
original code in edge Rails is therefore incorrect, in that it will  
create a method alias for Object.freeze instead of Module.freeze.

Bottom line: you’re doing the same thing as MRI so the code is okay. 🙂
