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
Enumerable#inject<\/code><\/a>
<\/blockquote>
each bit in the result is 1 if both corresponding bits in self and other are 1, 0 otherwise
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.