lib/rtsp/response.rb
def split_head_and_body_from raw_response
      head_and_body = raw_response.split("\r\n\r\n", 2)
      head = head_and_body.first
      body = head_and_body.last == head ? nil : head_and_body.last

      [head, body]
    end
# Takes the raw response text and splits it into a 2-element Array, where 0
# is the text containing the headers and 1 is the text containing the body.
#
# @param [String] raw_response
# @return [Array<String>] 2-element Array containing the head and body of
#   the response.  Body will be nil if there wasn't one in the response.
Takes the raw response text and splits it into a 2-element Array, where 0
is the text containing the headers and 1 is the text containing the body.
Takes the raw response text and splits it into a 2 - element Array where 0 is the text containing the headers and 1 is the text containing the body .
def split_head_and_body_from raw_response
      head_and_body = raw_response.split("\r\n\r\n", 2)
      head = head_and_body.first
      body = head_and_body.last == head ? nil : head_and_body.last
      [head, body]
    end
def split_head_and_body_from raw_response head_and_body = raw_response . split ( "\r\n\r\n" , 2 ) head = head_and_body . first body = head_and_body . last == head ? nil : head_and_body . last [ head , body ] end
Takes the raw response text and splits it into a 2-element Array, where 0
is the text containing the headers and 1 is the text containing the body.
Takes the raw response text and splits it into a 2 - element Array where 0 is the text containing the headers and 1 is the text containing the body .
2-element Array containing the head and body of the response. Body will be nil if there wasn't one in the response.
2 - element Array containing the head and body of the response . Body will be nil if there wasn ' t one in the response .
Array<String>
raw_response
None