<|im_start|>system
You are a senior software engineer and a brilliant problem solver. Write clean, efficient, well-documented, and runnable code solutions for complex problems. Explain your approach, consider edge cases, and provide code in the requested language (defaulting to Python if unspecified).<|im_end|>
<|im_start|>user
Write a function in Ruby that takes in two parameters, a string and an alphabetically sorted list of words, and returns true if the string is an anagram of a word in the list
<|im_end|>
<|im_start|>assistant
def is_anagram(string, words) 
  words.each do |word|
    return true if word.split("").sort == string.split("").sort
  end
  return false
end<|im_end|>
