this collect statement is not currently covered by the tests.  Can we have a more complex json hash which contains nested arrays and hashes?  I think this statement will not work as intended, and expects not only for the values in the array to respond to each (by passing them recursively to sort_hash), but also expects for values which _do_ respond to :each to behave the same way when hash.each { |k,v| } is called; however, this behavior is different for Hashes and Arrays.  So I would expect this to fail:

```ruby
sort_hash({
first_level_array: [ z: '1', second_level_array: 2, array_nested_hash: { c: '1', a: 2, b: 'three'}]
})
```

the first problem of expecting objects to respond to :each could be easily mitigated with:
```ruby
def sort_hash(hash)
return hash if !hash.is_a? Enumerable
```

Although I'm not sure if it's more appropriate to set the expectation on the Enumerable duck type, or the 'each' message type:

```ruby
def sort_hash(hash)
return hash if !hash.respond_to? :each
```
but the second issue is a bigger problem which requires more thought on how this recursive method should function, and/or may lead to breaking it into separate functions to ```recursively_sort_hash(has)``` and ```recursively_sort_array(array)```.