简体   繁体   中英

What does :& argument mean?

I don't understand the :&<\/code> argument for the inject method in this example:

[1, 2].map do |id|
  my_custom_method(MyModel.find(id))
end).inject(:&).map(&:category).uniq.compact.sort

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM