Method: Transproc::ArrayTransformations.insert_key
- Defined in:
- lib/transproc/array.rb
.insert_key(array, key) ⇒ Array
Wraps every value of the array to tuple with given key
The transformation partially inverses the extract_key.
206 207 208 |
# File 'lib/transproc/array.rb', line 206 def self.insert_key(array, key) map_array(array, ->(v) { { key => v } }) end |