Class: WebRTC::RTCDataChannelStats
- Defined in:
- lib/webrtc/stats_report.rb
Constant Summary
Constants inherited from RTCStats
Instance Attribute Summary collapse
-
#bytes_received ⇒ Object
readonly
Returns the value of attribute bytes_received.
-
#bytes_sent ⇒ Object
readonly
Returns the value of attribute bytes_sent.
-
#data_channel_identifier ⇒ Object
readonly
Returns the value of attribute data_channel_identifier.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
-
#messages_received ⇒ Object
readonly
Returns the value of attribute messages_received.
-
#messages_sent ⇒ Object
readonly
Returns the value of attribute messages_sent.
-
#protocol ⇒ Object
readonly
Returns the value of attribute protocol.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
Attributes inherited from RTCStats
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ RTCDataChannelStats
constructor
A new instance of RTCDataChannelStats.
- #to_h ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ RTCDataChannelStats
Returns a new instance of RTCDataChannelStats.
174 175 176 177 178 179 180 181 182 183 184 |
# File 'lib/webrtc/stats_report.rb', line 174 def initialize( = {}) super(.merge(type: :data_channel)) @label = [:label] @protocol = [:protocol] @data_channel_identifier = [:data_channel_identifier] @state = [:state] || :connecting @messages_sent = [:messages_sent] || 0 @bytes_sent = [:bytes_sent] || 0 @messages_received = [:messages_received] || 0 @bytes_received = [:bytes_received] || 0 end |
Instance Attribute Details
#bytes_received ⇒ Object (readonly)
Returns the value of attribute bytes_received.
171 172 173 |
# File 'lib/webrtc/stats_report.rb', line 171 def bytes_received @bytes_received end |
#bytes_sent ⇒ Object (readonly)
Returns the value of attribute bytes_sent.
171 172 173 |
# File 'lib/webrtc/stats_report.rb', line 171 def bytes_sent @bytes_sent end |
#data_channel_identifier ⇒ Object (readonly)
Returns the value of attribute data_channel_identifier.
171 172 173 |
# File 'lib/webrtc/stats_report.rb', line 171 def data_channel_identifier @data_channel_identifier end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
171 172 173 |
# File 'lib/webrtc/stats_report.rb', line 171 def label @label end |
#messages_received ⇒ Object (readonly)
Returns the value of attribute messages_received.
171 172 173 |
# File 'lib/webrtc/stats_report.rb', line 171 def @messages_received end |
#messages_sent ⇒ Object (readonly)
Returns the value of attribute messages_sent.
171 172 173 |
# File 'lib/webrtc/stats_report.rb', line 171 def @messages_sent end |
#protocol ⇒ Object (readonly)
Returns the value of attribute protocol.
171 172 173 |
# File 'lib/webrtc/stats_report.rb', line 171 def protocol @protocol end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
171 172 173 |
# File 'lib/webrtc/stats_report.rb', line 171 def state @state end |
Instance Method Details
#to_h ⇒ Object
186 187 188 189 190 191 192 193 194 195 196 197 |
# File 'lib/webrtc/stats_report.rb', line 186 def to_h super.merge( label: @label, protocol: @protocol, dataChannelIdentifier: @data_channel_identifier, state: @state, messagesSent: @messages_sent, bytesSent: @bytes_sent, messagesReceived: @messages_received, bytesReceived: @bytes_received ) end |