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: sweepline_intersector.rb
    path of file: ./repos/rgeo/lib/rgeo/cartesian
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# ------------------------------------------------
    
      def create_event_pair(segment)
        s = segment.s
        e = segment.e

        s_event = Event.new(s, segment)
        e_event = Event.new(e, segment)

        if s.y > e.y || (s.y == e.y && s.x < e.x)
          s_event.is_start = true
          e_event.is_start = false
        else
          s_event.is_start = false
          e_event.is_start = true
        end