Sha256: 09317d46bd1b04f7860acf4236cb6f013fa07162f0e32feb486eb1bb8bda2e44

Contents?: true

Size: 1.36 KB

Versions: 83

Compression:

Stored size: 1.36 KB

Contents

# frozen_string_literal: true

module RubyRabbitmqJanus
  module Janus
    # Modules for manipulate responses sending by Janus
    module Responses
      # Response for events message
      class Standard < Response
        # Return a integer to session
        def session
          data_id
        rescue
          raise Errors::Janus::ResponseStandard::Session
        end

        alias sender session

        # Return session used in request
        def session_id
          request['session_id']
        rescue
          raise Errors::Janus::ResponseStandard::Session_id
        end

        # Read response for plugin request
        def plugin
          request['plugindata']
        rescue
          raise Errors::Janus::ResponseStandard::Plugin
        end

        # Read data response for plugin request
        def plugin_data
          plugin['data']
        rescue
          raise Errors::Janus::ResponseStandard::PluginData
        end

        # Read data response for normal request
        def data
          request['data']
        rescue
          raise Errors::Janus::ResponseStandard::Data
        end

        # Read SDP response
        def sdp
          request['jsep']['sdp']
        rescue
          raise Errors::Janus::ResponseStandard::SDP
        end

        private

        def data_id
          data['id'].to_i
        end
      end
    end
  end
end

Version data entries

83 entries across 83 versions & 1 rubygems

Version Path
ruby_rabbitmq_janus-3.0.0.pre.336 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-3.0.0.pre.335 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-3.0.0.pre.334 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-3.0.0.pre.330 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-3.0.0.pre.328 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-3.0.0.pre.327 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-2.7.2 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-2.7.2.pre.322 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-2.7.2.pre.320 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-2.7.2.pre.319 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-2.7.2.pre.318 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-2.7.2.pre.317 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-2.7.2.pre.316 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-2.7.2.pre.315 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-2.7.2.pre.314 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-2.7.2.pre.312 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-2.7.2.pre.310 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-2.7.2.pre.309 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-2.7.2.pre.308 lib/rrj/janus/responses/standard.rb
ruby_rabbitmq_janus-2.7.2.pre.307 lib/rrj/janus/responses/standard.rb