# Re: Point an element in Hash Object

**URL:** <https://www.ruby-forum.com/t/re-point-an-element-in-hash-object/72890>\
**Category:** Ruby\
**Created:** [December 19, 2005, 11:58pm UTC](https://www.ruby-forum.com/t/re-point-an-element-in-hash-object/72890 "2005-12-19T23:58:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dasch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/b2d939/32.png) [@dasch](https://www.ruby-forum.com/u/dasch)\
**Post date:** [December 19, 2005, 11:58pm UTC](https://www.ruby-forum.com/t/re-point-an-element-in-hash-object/72890/1 "2005-12-19T23:58:50Z")

</div>

Oh… and your actual problem is that the HashReference object isn’t  
actually getting the to\_yaml call - it’s passing that through to the  
wrapped object, which writes itself out in full. You’ll need to add  
to\_yaml (or is it some other method? Check the YAML docs) to the methods  
that aren’t removed.

(instance\_methods - [“ **send** ”, “ **id** ”,“to\_yaml”]).each {|m|  
undef\_method m}

> > 
> 
> def initialize(hash, key)  
> @hash = hash  
> @key = key  
> end  
> def method\_missing(\*args, &block)  
> @hash[@key].send(\*args, &block)  
> end  
> end

#####################################################################################  
This email has been scanned by MailMarshal, an email content filter.  
#####################################################################################  
#####################################################################################  
This e-mail message has been scanned for Viruses and Content and cleared  
by NetIQ MailMarshal  
#####################################################################################
