To me, this makes sense as a method:

    def package_clauses(type, content_clauses)
        case type
        when FilterRule::ERRATA
          package_clauses_for_errata(content_clauses)
        when FilterRule::PACKAGE_GROUP
          package_clauses_for_group(content_clauses)
        else
           {"$or" => content_clauses}
        end
    end