Refactor: Change HumanError from a module to a class

We need to be able to have instances of `HumanError` which have their own
settings compared to the 'global' configuration.  This is the first step towards
doing that.

We can no longer extend `HumanError` although since we were not yet doing that,
we should be fine.

--------------------------------------------------------------------------------
Change-Id:     I1625596705244d50199816ec4930bf96631a3878
Signed-off-by: Jeff Felchner <accounts+git@thekompanee.com>
Feature: Allow HumanError to be instantiated with a configuration

We want to be flexible by allowing an individual instance of `HumanError` to
have its own configuration _or_ use a global configuration.

We allow `HumanError.new` to accept a block which yields the _local_
configuration and can be configured separately from the global config.

--------------------------------------------------------------------------------
Change-Id:     I2754a39559fe2ffdf62d0a59dc89a4cf9a362ef9
Signed-off-by: Jeff Felchner <accounts+git@thekompanee.com>
Feature: Add Configuration#to_h

We need a way to merge our existing 'local' HumanError instance configuration
with the parameters that we pass in when instantiating each individual error.
We can't do that with a `Configuration` object, but we can do that with a `Hash`.

--------------------------------------------------------------------------------
Change-Id:     I4f2947f841362deb7ae4533107530fc041a21e18
Signed-off-by: Jeff Felchner <accounts+git@thekompanee.com>
Feature: Allow a HumanError instance to 'look up' an error by name

This is so that we can configure each instance of an error more easily.

We currently are not rescuing the `NameError` that will be raised if the error
name provided does not exist:

For example:

    HumanError.new.fetch('foo')

would throw a `NameError`.  We should probably handle that in a more graceful
way, even if it means wrapping it in something like
`HumanError::ErrorLookupError`.

--------------------------------------------------------------------------------
Change-Id:     Ie071ef0b23e6c74dddb1a0108d5cb03c92ff3522
Signed-off-by: Jeff Felchner <accounts+git@thekompanee.com>
Feature: Allow local configuration to be passed to looked up errors

This uses `Configuration#to_h` to generate a set of initialization values that
are passed into each error that is looked up via `HumanError#fetch`.

This allows each instance of `HumanError` to create errors with different
information, even if they are of the same type.

Example:

  error = HumanError.new do |config|
            config.api_version = 1
          end

  error.fetch('RequestError').api_version # => 1

but if we created a new `HumanError` instance with an `api_version` of `2` then
calling `fetch('RequestError').api_version` on that instance would yield `2`.

--------------------------------------------------------------------------------
Change-Id:     I0c26b3f59af2588dbd52384bdadd8bce0ee5180d
Signed-off-by: Jeff Felchner <accounts+git@thekompanee.com>
Feature: Values passed in when looking up errors override local config

This lets us have reasonable defaults by way of a local configuration but also
allows us to override those defaults in a specific case if we need to:

Example:

  human_error = HumanError.new do |config|
                  config.api_version = 2
                end

  human_error.fetch('RequestError', api_version: 1).api_version # => 1

--------------------------------------------------------------------------------
Change-Id:     Iab2759927308fee0608a04ec67bc7cafc1462790
Signed-off-by: Jeff Felchner <accounts+git@thekompanee.com>

<previous_commit>
Feature: Allow HumanError instances to both lookup and raise errors

This is effectively just a shortcut for us so we can abstract away the raising
of errors.

--------------------------------------------------------------------------------
Change-Id:     I5f7121a5a959da866dc5f5e9315bded4629fa93c
Signed-off-by: Jeff Felchner <accounts+git@thekompanee.com>

<previous_commit>
Tests: Add a regression test for global config being overridden by local config

Any time a global configuration value is set, an instance value of the same type
should override the global value.

--------------------------------------------------------------------------------
Change-Id:     Ia606a592749629ea807403cd237aac6042195c68
Signed-off-by: Jeff Felchner <accounts+git@thekompanee.com>
Version Bump to 1.4.0