Class: WebRTC::DataChannelMessage

Inherits:
Object
  • Object
show all
Defined in:
lib/webrtc/parity_types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, is_binary) ⇒ DataChannelMessage

Returns a new instance of DataChannelMessage.



216
217
218
219
# File 'lib/webrtc/parity_types.rb', line 216

def initialize(data, is_binary)
  @data = data
  @is_binary = is_binary
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



214
215
216
# File 'lib/webrtc/parity_types.rb', line 214

def data
  @data
end

Instance Method Details

#binary?Boolean

Returns:

  • (Boolean)


221
222
223
# File 'lib/webrtc/parity_types.rb', line 221

def binary?
  @is_binary
end

#text?Boolean

Returns:

  • (Boolean)


225
226
227
# File 'lib/webrtc/parity_types.rb', line 225

def text?
  !@is_binary
end