Class: WebRTC::MessageEvent

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, is_binary) ⇒ MessageEvent

Returns a new instance of MessageEvent.



201
202
203
204
205
206
# File 'lib/webrtc/data_channel.rb', line 201

def initialize(data, is_binary)
  @data = data
  @is_binary = is_binary
  @origin = ''
  @last_event_id = ''
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



199
200
201
# File 'lib/webrtc/data_channel.rb', line 199

def data
  @data
end

#last_event_idObject (readonly)

Returns the value of attribute last_event_id.



199
200
201
# File 'lib/webrtc/data_channel.rb', line 199

def last_event_id
  @last_event_id
end

#originObject (readonly)

Returns the value of attribute origin.



199
200
201
# File 'lib/webrtc/data_channel.rb', line 199

def origin
  @origin
end

Instance Method Details

#binary?Boolean

Returns:

  • (Boolean)


208
209
210
# File 'lib/webrtc/data_channel.rb', line 208

def binary?
  @is_binary
end

#text?Boolean

Returns:

  • (Boolean)


212
213
214
# File 'lib/webrtc/data_channel.rb', line 212

def text?
  !@is_binary
end