Class: WebRTC::RTCIceServer

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ RTCIceServer

Returns a new instance of RTCIceServer.



59
60
61
62
63
64
65
66
# File 'lib/webrtc/configuration.rb', line 59

def initialize(options = {})
  @urls = normalize_urls(options[:urls] || options[:url])
  @username = options[:username]
  @credential = options[:credential]
  @credential_type = options[:credential_type] || options[:credentialType] || :password

  validate!
end

Instance Attribute Details

#credentialObject

Returns the value of attribute credential.



57
58
59
# File 'lib/webrtc/configuration.rb', line 57

def credential
  @credential
end

#credential_typeObject

Returns the value of attribute credential_type.



57
58
59
# File 'lib/webrtc/configuration.rb', line 57

def credential_type
  @credential_type
end

#urlsObject

Returns the value of attribute urls.



57
58
59
# File 'lib/webrtc/configuration.rb', line 57

def urls
  @urls
end

#usernameObject

Returns the value of attribute username.



57
58
59
# File 'lib/webrtc/configuration.rb', line 57

def username
  @username
end

Instance Method Details

#to_hObject



68
69
70
71
72
73
74
# File 'lib/webrtc/configuration.rb', line 68

def to_h
  hash = { urls: @urls }
  hash[:username] = @username if @username
  hash[:credential] = @credential if @credential
  hash[:credentialType] = @credential_type if @credential
  hash
end