Ruby Symbol#match is actually String#=~
So if you want a block form of String#match, you should cast to string first
String(i_can_be_a_symbol).match(/.*kittens are (?<opinion_on_kittens>\w+)/){|match| match['opinion_on_kittens']}
Written by Titov Andrey
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#