← Graph

Hash#to_proc

concept 1 connections

Ruby core method that converts a Hash into a proc equivalent to `->(key){ hash[key] }`, implemented in Rubinius as `method(:[]).to_proc`. Enables patterns like `keys.map(&hash)` to look up each key and return the values.

category
pattern
about
Hash#to_proc concept
Shows hash.to_proc and using &hash with map.

Provenance

Read by
1 extraction