Verify the text is not present using appium with ruby on an ios app

I have to verify that after deleting an item it is not present any more in the list.
But now sure what can i use using Ruby to verify the item is not present by its text?

I am using following code to verify if the text is present so that i can revert it later to verify that the text is not present:

def folder_removed

$driver.wait {
  folder_name = $driver.find_element(:xpath, '//UIAApplication[1]/UIAWindow[1]/UIATableView[1]/UIATableCell[matches(@name, 'FolderToRemove')]')
  folder_name.displayed?

}

end

but its giving me syntax error

Wrap your find_element in a begin/rescue. If it raises an exception, then you know it wasn’t there.

Alternatively, you can use find_elements, then check the length of the return value – if it’s 0, then the text wasn’t there.