-
-
Save anonymous/e02ba24385664eb6e340 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Problem: Need to see if string element ["GroupName"] within array "myarr" indexes exists within cp["notes"] | |
myarr = [{"GroupName"=>"MyFirstGroup", "Id"=>114}, {"GroupName"=>"Interest - Email", "Id"=>101}, {"GroupName"=>"New Customer", "Id"=>102}, {"GroupName"=>"New Lead", "Id"=>135}] | |
cp["notes"] = "Hello. This is fun. MyFirstGroup is fun." | |
Normally, I would do: | |
myarr.each do |arr| | |
puts "Yup, it's here" if cp["notes"].include? arr["GroupName"] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment