You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: titles_list.rb
    path of file: ./repos/kitsu-server/app/models
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# Encapsulates the title logic for a Media, making it much easier to work with.
class TitlesLis
    
  def first_title_for(preferences)
    list = preferences & %i[canonical romanized original localized]
    list.each do |key|
      title = public_send(key)
      return title if title.present?
    end
  end