Closed khchen closed 2 years ago
Allow following code:
class Foo def []=(key, value) self._attr[key] = value end end f = Foo() f["a" + "b"] = 123 assert(f.ab == 123)
Moreover, maybe @getter and @setter can be renamed to _getter and _setter. Don't need to limit them be used in native module only.
@getter
@setter
_getter
_setter
class Foo def _getter(key) # do someing... return self._attr[key] end def _setter(key, value) # do someing... self._attr[key] = value end end
close temporary
Allow following code:
Moreover, maybe
@getter
and@setter
can be renamed to_getter
and_setter
. Don't need to limit them be used in native module only.