Module: HashOp::Read

Defined in:
lib/hash_op/read.rb

Overview

A set of method to read values in hashes.

Class Method Summary collapse

Class Method Details

.values_at_path(hashes, path) ⇒ Object

Parameters:

  • hashes (Array)
  • path (Array or String)


10
11
12
# File 'lib/hash_op/read.rb', line 10

def values_at_path(hashes, path)
  hashes.map { |hash| Deep.fetch(hash, path) }
end