aetherknight / recursive-open-struct

OpenStruct subclass that returns nested hash attributes as RecursiveOpenStructs
Other
276 stars 54 forks source link

fix sub-element bug and dry internal handling of options #58

Closed fledman closed 4 years ago

fledman commented 5 years ago

in current master:

  1. the[]= syntax does not properly update @sub_elements
  2. the first call of the .= syntax does not properly update @sub_elements
  3. every time you want to add a new option, you need to adjust each self.class.new callsite to pass the new option along recursively

this PR:

  1. fixes the []= syntax
  2. routes the.= syntax through []=
  3. drys up sub-element creation such that each callsite only needs to specify the options it is overriding
  4. removes the Ruby 1.9 backport

the external api should not change at all

fledman commented 5 years ago

@aetherknight some changes ready for review

aetherknight commented 4 years ago

I attempted to resolve a merge conflict on this PR using Github's online merge conflict editor. However, the tests were still failing. Instead, I made a local branch and fixed up the branch there.