hoxworth/json-schema — pull request #172 by pd (2014-11-02 16:09:40+00:00)
Title: General cleanup, mostly focused on attributes/*

Driven mostly by running `flog`, `flay` and `reek` locally; CodeClimate comparison is available [here](https://codeclimate.com/github/pd/json-schema/compare/better-climate).

`Showing 39 changed files with 523 additions and 597 deletions.`, but that's largely due to removing a level or two of indents from the `FooAttribute` classes.

Primary changes:

1. Almost all `FooAttribute` classes started with `if data.is_a?(Foo)`; converted these to `return unless data.is_a?(Foo)`. See bc04d2f.
2. Introduce locals for repeated traversals of objects (eg, `current_schema.schema`).
3. `minLength`, `maxItems`, `maximum`, etc etc all derive from a `LimitAttribute` class, and live in the same file (175e7dc). I don't really like growing the class hierarchy, and `LimitAttribute` itself is now too abstract for my taste, but each of those classes were previously copypasta with mostly one or two keywords changed.
4. I can't get 1.8 to run locally (segfaults loading rubygems!), but I think I've fixed the `NoMethodError: undefined method `keys' for [["c", "c"]]:Array` error there.

If this is too big/insane to review reasonably, lemme know. I could pull the unnesting commit out of this and do it in a separate PR instead, which might make this more grokkable.