From: ts Date: 2008-04-30T23:05:27+09:00 Subject: Re: How to create "def method(item)= (value)" ? I単aki Baz Castillo wrote: > #what I want but it's not possible: There is always the stupid way vgs% cat b.rb #!/usr/bin/ruby class A class Int__ def initialize(obj, name) @self = obj @name = name end def []=(x, y) s = @self n = @name s.instance_eval { instance_variable_get(n)[x] = y @modified = true } end end def param @param ||= {} Int__.new(self, '@param') end end a = A.new a.param[:x] = 24 p a vgs% vgs% ./b.rb #24}, @modified=true> vgs% Guy Decoux