Class: OpenTok::Stream

Inherits:
Object
  • Object
show all
Defined in:
lib/opentok/stream.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object



32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/opentok/stream.rb', line 32

def method_missing(method, *args, &block)
  camelized_method = method.to_s.camelize(:lower)
  if @json.has_key? camelized_method and args.empty?
    # TODO: convert create_time method call to a Time object
    if camelized_method == 'outputMode'
      @json[camelized_method].to_sym
    else
      @json[camelized_method]
    end
  else
    super method, *args, &block
  end
end

Instance Attribute Details

#layoutClassListarray

An array of the layout classes for the stream.

Returns:

  • (array)

    the current value of layoutClassList



17
18
19
# File 'lib/opentok/stream.rb', line 17

def layoutClassList
  @layoutClassList
end

#videoTypestring

The videoType property is either “camera” or “screen”.

Returns:

  • (string)

    the current value of videoType



17
18
19
# File 'lib/opentok/stream.rb', line 17

def videoType
  @videoType
end

Instance Method Details

#to_jsonObject

A JSON-encoded string representation of the stream.



26
27
28
# File 'lib/opentok/stream.rb', line 26

def to_json
  @json.to_json
end