I'm trying to loop through and match the following string:
@custom_channels = { cnn: 2, abc: 90 }
I then want to be able to check/match against each and return the channel number (e.g. 90):
listen_for /channel to (#{@custom_channels.join('|')})/i do |name|
change_channel @custom_channels[name.downcase]
end
I keep getting the following error:
scraper.rb:5:in `<main>': undefined method `join' for {:cnn=>2, :abc=>90}:Hash (NoMethodError)
joinhere? What are you trying to achieve with this?