diff options
author | Steve Klabnik + Katrina Owen <steve+katrina@steveklabnik.com> | 2012-12-21 22:38:52 +0000 |
---|---|---|
committer | Steve Klabnik + Katrina Owen <steve+katrina@steveklabnik.com> | 2012-12-21 23:49:43 +0000 |
commit | b02ebe73cf0d24139efbcb00b7c9eb6235794e58 (patch) | |
tree | 1b10465e582f68bbbdb73b5a484e9343d55ce436 /activesupport/test/core_ext/bigdecimal_test.rb | |
parent | 3c2c1a46064684a1becc8ae7b6b7fe6eebf9651a (diff) | |
download | rails-b02ebe73cf0d24139efbcb00b7c9eb6235794e58.tar.gz rails-b02ebe73cf0d24139efbcb00b7c9eb6235794e58.tar.bz2 rails-b02ebe73cf0d24139efbcb00b7c9eb6235794e58.zip |
Refactor Hash.from_xml.
Three basic refactors in this PR:
* We extracted the logic into a method object. We now don't define a tone of extraneous methods on Hash, even if they were private.
* Extracted blocks of the case statement into methods that do the work. This makes the logic more clear.
* Extracted complicated if clauses into their own query methods. They often have two or three terms, this makes it much easier to see what they _do_.
We took care not to refactor too much as to not break anything, and put comments where we suspect tests are missing.
We think ActiveSupport::XMLMini might be a good candidate to move to a plugin in the future.
Diffstat (limited to 'activesupport/test/core_ext/bigdecimal_test.rb')
0 files changed, 0 insertions, 0 deletions