Class: WebRTC::RTCPeerConnectionStats
- Defined in:
- lib/webrtc/stats_report.rb
Constant Summary
Constants inherited from RTCStats
Instance Attribute Summary collapse
-
#data_channels_closed ⇒ Object
readonly
Returns the value of attribute data_channels_closed.
-
#data_channels_opened ⇒ Object
readonly
Returns the value of attribute data_channels_opened.
Attributes inherited from RTCStats
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RTCPeerConnectionStats
constructor
A new instance of RTCPeerConnectionStats.
- #to_h ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ RTCPeerConnectionStats
Returns a new instance of RTCPeerConnectionStats.
156 157 158 159 160 |
# File 'lib/webrtc/stats_report.rb', line 156 def initialize( = {}) super(.merge(type: :peer_connection)) @data_channels_opened = [:data_channels_opened] || 0 @data_channels_closed = [:data_channels_closed] || 0 end |
Instance Attribute Details
#data_channels_closed ⇒ Object (readonly)
Returns the value of attribute data_channels_closed.
154 155 156 |
# File 'lib/webrtc/stats_report.rb', line 154 def data_channels_closed @data_channels_closed end |
#data_channels_opened ⇒ Object (readonly)
Returns the value of attribute data_channels_opened.
154 155 156 |
# File 'lib/webrtc/stats_report.rb', line 154 def data_channels_opened @data_channels_opened end |
Instance Method Details
#to_h ⇒ Object
162 163 164 165 166 167 |
# File 'lib/webrtc/stats_report.rb', line 162 def to_h super.merge( dataChannelsOpened: @data_channels_opened, dataChannelsClosed: @data_channels_closed ) end |