Forum: Ruby on Rails how can I add a new fct to the class Hash

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.
14b7344777a56ac9a1fad849f5d6da2a?d=identicon&s=25 sayoyo Sayoyo (sayoyo)
on 2006-03-10 16:45
(Received via mailing list)
Hi,

We use a lot of "hash" in our program and we want to
add a new function to the class, does someone know how
to do this????

Thanks you very much

Saiho

The mind is its own place, and in itself.
Can make a Heaven of Hell, a Hell of Heaven.

http://www.geocities.com/sayoyo/

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
59ea1b450935b9d70abfec4186b7a4d5?d=identicon&s=25 Jeff Coleman (progressions)
on 2006-03-10 17:15
class Hash
  def my_method(params)
    ...
  end
end

Classes are always open and can be extended like so.

Saiho sayoyo wrote:
> Hi,
>
> We use a lot of "hash" in our program and we want to
> add a new function to the class, does someone know how
> to do this????
>
> Thanks you very much
>
> Saiho
>
> The mind is its own place, and in itself.
> Can make a Heaven of Hell, a Hell of Heaven.
>
> http://www.geocities.com/sayoyo/
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
This topic is locked and can not be replied to.