Makes sense; will update implementation.—
Sent from Mailbox for iPhone

On Wed, Jan 15, 2014 at 4:44 AM, Tamir Duberstein
<notifications@github.com> wrote:

>> +    # Returns a hash using the elements of self as keys and the result of the
>> +    # given block as values.
>> +    #
>> +    # @return [Hash]
>> +    #
>> +    # @example
>> +    #   [].transform # => {}
>> +    #   { first_name: 'john',  last_name: 'doe' }.transform { |_key, value|
>> +    #     value.capitalize
>> +    #   }
>> +    #
>> +    #   # => { first_name: 'John', last_name: 'Doe' }
>> +    #
>> +    #
>> +    def transform(&block)
>> +      each_with_object({}) { |e, a| a[Array(e).first] = block.call(*e) }
> fwiw, I believe
> ```ruby
> Hash[
>   map { |e| [Array(e).first, yield *e] }
> ]
> ```
> is simpler and it is definitely more performant (http://hervalicio.us/post/32332064580/whats-the-best-way-to-convert-a-hash-into-another-hash)
> ---
> Reply to this email directly or view it on GitHub:
> https://github.com/bbatsov/powerpack/pull/20/files#r8887760