From: Yossef Mendelssohn Date: 2009-08-01T01:50:28+09:00 Subject: Modifying Struct members Is it possible to modify the members of a Struct class once it's been created, yet retain all other behavior? An example: Thing = Struct.new(:a, :b, :c) do def some_method end end Is there a way to modify Thing so it behaves as if it were effectively created like so? Thing = Struct.new(:a, :b, :c, :d) do def some_method end end Re-assigning Thing to a new Struct obviously doesn't work because then the behavior is lost. Altering Thing.members seemed promising, but that didn't work either. Adding attr_accessor for :d isn't good because I need Thing.new['d'] to work. Thoughts? -- -yossef