array_One = ["RESPONSE_TEXT_CONTENT_TYPE", "RESPOSNSE_KEY"]
array_Two = ["RESPONSE_TEXT_CONTENT_TYPE = 'responseTextContentType'\n"]
["CURRENT_USER_ID = 'careUserId'\n"]
["RESPOSNSE_KEY = 'responseKey'\n" ]
我需要将arra_Two转换为某个哈希值。如下所示,
hash_One = ["RESPONSE_TEXT_CONTENT_TYPE" =>responseTextContentType, "CURRENT_USER_ID" => careUserId "RESPOSNSE_KEY" => responseKey]
我可以采取什么方式
RESPONSE_TEXT_CONTENT_TYPE = 20
RESPOSNSE_KEY = 5
test = 10
x = 5
arr1 = [RESPONSE_TEXT_CONTENT_TYPE,test,RESPOSNSE_KEY,x]
arr2 = [test,x,'local',123,RESPONSE_TEXT_CONTENT_TYPE]
arr3 = arr1 & arr2
puts arr3.inspect