def processRef(ref, join=True):
    """
    Convert a Ref object parsed by PyDBML from dbml into SQLite DDL. 

    Parameters:
    ref (Ref): Ref object generated by PyDBML.
    join (bool): Default is True. If True, function will `join` the result list of string segments with an empty string and return the resulting string to you. Otherwise, the one-dimensional list of string segments will be returned to you directly.

    Returns:
    str or list of str: SQLite DDL for defining a foreign key within a `CREATE TABLE` statement.
    """
    segments = []
    segments.append('  FOREIGN KEY(')
    segments.append(f'{ref.col.name}) REFERENCES {ref.ref_table.name}({ref.ref_col.name})')
    if ref.on_update:
        segments.append(f' ON UPDATE {ref.on_update.upper()}')
    if ref.on_delete:
        segments.append(f' ON DELETE {ref.on_delete.upper()}')
    if join:
        segments = "".join(segments)
    return segments