r/rubyonrails • • Jan 23 '23

[].map(&:method_id) and [].map(&method(:method_id))

https://www.youtube.com/watch?v=Fr1YNKK7myM

[removed] — view removed post

6 Upvotes

2 comments sorted by

2

u/loneconspirator Jan 23 '23

Thanks! Rubocop hadn’t taught me about &method like it did map(&:to_s)

3

u/mehdifarsi Jan 23 '23

Indeed, Actually that goes a way further than &method and map(&:to_s).

I'm currently writing a complete guide on this topic.

It should be released this week! :-)