Class: WebRTC::RTCStats
- Inherits:
-
Object
- Object
- WebRTC::RTCStats
- Defined in:
- lib/webrtc/stats_report.rb
Direct Known Subclasses
RTCDataChannelStats, RTCInboundRtpStreamStats, RTCOutboundRtpStreamStats, RTCPeerConnectionStats, RTCTransportStats
Constant Summary collapse
- TYPES =
%i[ codec inbound_rtp outbound_rtp remote_inbound_rtp remote_outbound_rtp media_source csrc peer_connection data_channel transceiver sender receiver transport candidate_pair local_candidate remote_candidate certificate ice_server ].freeze
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#timestamp ⇒ Object
readonly
Returns the value of attribute timestamp.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RTCStats
constructor
A new instance of RTCStats.
- #to_h ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ RTCStats
Returns a new instance of RTCStats.
54 55 56 57 58 |
# File 'lib/webrtc/stats_report.rb', line 54 def initialize( = {}) @id = [:id] || generate_id @timestamp = [:timestamp] || Time.now.to_f * 1000 @type = [:type] end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
52 53 54 |
# File 'lib/webrtc/stats_report.rb', line 52 def id @id end |
#timestamp ⇒ Object (readonly)
Returns the value of attribute timestamp.
52 53 54 |
# File 'lib/webrtc/stats_report.rb', line 52 def @timestamp end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
52 53 54 |
# File 'lib/webrtc/stats_report.rb', line 52 def type @type end |
Instance Method Details
#to_h ⇒ Object
60 61 62 63 64 65 66 |
# File 'lib/webrtc/stats_report.rb', line 60 def to_h { id: @id, timestamp: @timestamp, type: @type } end |