From: botp Date: 2011-02-04T12:44:23+09:00 Subject: Re: Setter method for Hash value On Fri, Feb 4, 2011 at 11:22 AM, botp wrote: sorry, ignore the previous unclear post.. try again, class MyClass def props some_data = SomeClass::get_prop self end def []=(key,value) p "i was called" SomeClass::set_prop(key, value) end end #=> nil class SomeClass class << self @@h={} def get_prop @@h end def set_prop key,value @@h[key]=value end def show @@h end end end #=> nil c=MyClass.new #=> # c.props #=> # c.props[:a]=1 "i was called" #=> 1 c.props[:b]=2 "i was called" #=> 2 c.props #=> # SomeClass::show #=> {:a=>1, :b=>2} best regards -botp