class Attio::Util::IdExtractor

def extract_from_hash(hash, key = nil)

def extract_from_hash(hash, key = nil)
  return nil unless hash.is_a?(Hash)
  if key
    # Try both symbol and string keys
    hash[key] || hash[key.to_s] || hash[key.to_sym]
  else
    # Try common ID keys in order of preference
    common_keys.each do |k|
      value = hash[k] || hash[k.to_s]
      return value if value
    end
    nil
  end
end