Class: SDP::Parser

Inherits:
Parslet::Parser
  • Object
show all
Defined in:
lib/sdp/parser.rb

Overview

Class for parsing SDP description text, ideally when receiving as some sort of client that uses SDP for describing the session for that protocol.

This parser could raise an error when not finding a required SDP field, but was instead designed to not do so. For example, if the parser parses the text from an SDP description, and that text is missing the Timing field (t=), the RFC 4566 implies that this description isn’t valid (because that field is required). Instead ofraising an exception, the parser lets the SDP::Description class deal with this.

Also, an object of this class parses key/value pairs, where, as a by-product of using Parslet, values end up being Parslet::Slice objects. It’s worth pointing out that while those are not Strings, they mostly behave like Strings. See the Parslet docs for more info.