#Scope in Ruby
def longest_palindrome(words)
words.split.each do |word|
#Initialize current longest palindrome
curr_palindrome = ""
#replace current palindrome if longer
curr_palindrome = word if word.length > curr_palindrome.length && palindrome?(word)
end
return curr_palindrome
end ##Error curr_palindrome is out of scope. Only accessible within the each loop on lines 3 - 9
undefined local variable or method `curr_palindrome' for main:Object