Forum: Ruby Re: Point an element in Hash Object

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1c1e3bdfe006a22214102fcd6434a012?d=identicon&s=25 Daniel Sheppard (Guest)
on 2005-12-19 23:58
(Received via mailing list)
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
#####################################################################################
This topic is locked and can not be replied to.