class Bandwidth::Session

A session object

Attributes

id[RW]

Unique id of the session @return [String]

tag[RW]

User defined tag to associate with the session @return [String]

Public Class Methods

from_hash(hash) click to toggle source

Creates an instance of the object from a hash.

# File lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb, line 32
def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash['id']
  tag = hash['tag']

  # Create object from extracted values.
  Session.new(id,
              tag)
end
names() click to toggle source

A mapping from model property names to API property names.

# File lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb, line 18
def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['tag'] = 'tag'
  @_hash
end
new(id = nil, tag = nil) click to toggle source
# File lib/bandwidth/web_rtc_lib/web_rtc/models/session.rb, line 25
def initialize(id = nil,
               tag = nil)
  @id = id
  @tag = tag
end