Module: Portable::Util::Pivotable

Included in:
Data::Provider, Document
Defined in:
lib/portable/util/pivotable.rb

Overview

Mixes in helpers for asserting uniqueness across collections

Instance Method Summary collapse

Instance Method Details

#pivot_by_name(array) ⇒ Object



14
15
16
# File 'lib/portable/util/pivotable.rb', line 14

def pivot_by_name(array)
  array.each_with_object({}) { |object, memo| memo[object.name] = object }
end