A method call for every element
`%w{ david black }.map(&:capitalize)` returns `["David", "Black"]`. It does the same job as `map { |str| str.capitalize }`: each string receives `capitalize`. section 14.1.4
The shorthand has two parts. `:capitalize` is a Symbol naming the method; `&` calls its `to_proc` method and supplies the resulting Proc as the call’s block. The Proc sends that method name to each object it receives. Removing the parentheses—`map &:capitalize`—does not turn it into a literal block. section 14.1.4
class Symbol
def to_proc
Proc.new {|obj| obj.public_send(self) }
end
end
A simplified implementation makes the dispatch visible: the returned Proc accepts an object and uses `public_send(self)` to send it the method named by the symbol. section 14.1.4
`&` works with other objects that provide `to_proc`. A Proc’s `to_proc` returns itself; a Hash can supply a Proc for lookups, as in `[1988, 1996].map(&albums)`. Keep the `&`: passing a Proc as an ordinary argument does not make it the block. Nor can one call supply both an `&`-marked argument and an inline block. section 14.1.3 section 14.7
Choose a maximum by calling a method
`tickets.max_by(&:price)` uses each ticket’s `price` as the comparison value. The shorthand fits when the block’s job is simply to call a named method on each item. section 3.6.3
