Class: SippyCup::Media::RTPPayload
- Inherits:
-
Object
- Object
- SippyCup::Media::RTPPayload
- Defined in:
- lib/sippy_cup/media/rtp_payload.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#header ⇒ Object
readonly
Returns the value of attribute header.
Instance Method Summary collapse
-
#initialize(payload_id = 0) ⇒ RTPPayload
constructor
A new instance of RTPPayload.
- #method_missing(method, *args) ⇒ Object
- #to_bytes ⇒ Object
Constructor Details
#initialize(payload_id = 0) ⇒ RTPPayload
Returns a new instance of RTPPayload.
10 11 12 |
# File 'lib/sippy_cup/media/rtp_payload.rb', line 10 def initialize(payload_id = 0) @header = RTPHeader.new payload_id: payload_id end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/sippy_cup/media/rtp_payload.rb', line 18 def method_missing(method, *args) if method.to_s =~ /^rtp_/ method = method.to_s.sub(/^rtp_/, '').to_sym @header.send method, *args else super end end |
Instance Attribute Details
#header ⇒ Object (readonly)
Returns the value of attribute header.
8 9 10 |
# File 'lib/sippy_cup/media/rtp_payload.rb', line 8 def header @header end |
Instance Method Details
#to_bytes ⇒ Object
14 15 16 |
# File 'lib/sippy_cup/media/rtp_payload.rb', line 14 def to_bytes @header.to_s + media end |