jetrockets/attrio — pull request #1 by JoshCheek (2013-05-31 07:43:02+00:00)
Title: Remove some core extensions

Begins to remove core extensions. Some were unused, some only used in a handful of places, or by other core extensions.

Some I left in b/c the code that used them did not get tested

`Hash#slice` was like this, no tests hit it, but they hypothetically could if they were more comprehensive. I tried to add the tests on it, but they did not do what I expected, so I figure I don't fully understand it. Figured it was best to remove them and not touch `Hash#slice` (@unclebob's "I'm not touching it!" 26 min mark in [this talk](http://blip.tv/railsconf/railsconf-09-robert-martin-what-killed-smalltalk-could-kill-ruby-too-2099970)). Presumably they go in `spec/attrio/attrio_spec.rb` but in their current form, they only check whether the code responds to the method name.

Also, while checking to see if I could get rid of `#present?`, ran across "lib/attrio/reset.rb" I changed `.select{ |attribute| !attribute.default_value.nil? }` to `.select{ |attribute| attribute.default_value }`. Nothing failed, but its implementation seems very specific, presumably b/c false is an acceptable default value, but nothing verifies that it treats false correctly, so decided to leave that one alone out of fear of breaking it. If I had more confidence in the test suite, I'd have tried to get rid of this (and once we get `#present?` taken care of, it would be easy to get rid of `#blank?`, as well)

After that, I'd probably try to get rid of the class variables in the eval'd string (class vars are nonsensical, I've lost half a day to a bug from `cattr_accessor`'s use of them, I think the only reasonable approach is to never ever use them).